Discussions
Activity
Home
›
Community
›
General
ITT: Fibonacci
Viani
2013-03-19 05:48:30
edited 2013-03-19 05:48:30
in
General
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597,
2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418,
317811, 514229, 832040, 1346269 u.s.w.
Tagged:
counterclock
[thistaghasbeenblockedby
monica_nolan
stolen
Comments
Imipolex G
2013-03-19 11:47:35
Touch the cow. Do it now.
I think I've seen this before
Bunny
2013-03-19 11:53:30
Not a hybrid rabbit-skink spirit
fibonacci :: [Integer]
fibonacci = 0 : 1 : zipWith (+) fibonacci (tail fibonacci)
isFibonacci
isFibonacci :: Integer -> Bool
isFibonacci x = fibonacciCheck x 0
fibonacciCheck :: Integer -> Integer -> Bool
fibonacciCheck x y
| x < z = False
| x == z = True
| otherwise = fibonacciCheck x (y + 1)
where z = fibonacci !! fromIntegral y
Sign In
or
Register
to comment.
Sign In
•
Register
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
All Categories
16.2K
Site Business
537
Administrivia
19
Announcements
29
Community
16.6K
General
13.8K
Chocolate
666
Chocolate II
61
Design
60
Liveblogs
94
Roleplay & Games
415
Talk
197
Testing Grounds
34
Media
826
Artistic Pursuits
111
General Media
714
Site Discussion
45
Site Talk
35
Suggestions
9
Powered by Vanilla
Comments