some more scripts

This commit is contained in:
Jonas_Jones 2023-09-11 23:13:42 +02:00
parent e4cc2294c0
commit fac583d149
3 changed files with 192 additions and 0 deletions

9
fibonaccilike.hs Normal file
View 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