mirror of
https://github.com/JonasunderscoreJones/turbo-octo-potato.git
synced 2025-10-26 02:29:18 +01:00
some more scripts
This commit is contained in:
parent
e4cc2294c0
commit
fac583d149
3 changed files with 192 additions and 0 deletions
9
fibonaccilike.hs
Normal file
9
fibonaccilike.hs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
chebyshev :: Int -> Int
|
||||
chebyshev 0 = 0
|
||||
chebyshev 1 = 2
|
||||
chebyshev n = smartchebyshev 2 (n+1) 2 0
|
||||
|
||||
smartchebyshev :: Int -> Int -> Int -> Int -> Int
|
||||
smartchebyshev curr max n1 n2
|
||||
| curr == max = n1
|
||||
| otherwise = smartchebyshev (curr + 1) max (4 * n1 - n2) n1
|
||||
Loading…
Add table
Add a link
Reference in a new issue