I was watching the results of my Fibobacci sequence implementation in Haskell when I realised some "strange" forms in the optput of the numbers.
First of all, this is the Haskell code I've come up with:
fib :: Integer -> [Integer]
fib 0 = [0]
fib 1 = [0, 1]
fib a = (fib' 0 1 [0,1] 1 a)
fib' :: Integer -> Integer -> [Integer] -> Integer -> Integer -> [Integer]
fib' n1 n2 l cont n
| cont == n = l
| otherwise = (fib' n2 n3 (l++[n3]) (cont+1) n)
where n3 = n2 + n1
For something like fib 10 the output would be : [0,1,1,2,3,5,8,13,21,34,55] Then I wanted to try something like fib 1000, while the numbers are incredibly big and all... what I saw was some strange elipses formed by the "," that is printed out between each Integer from the list, for example:
So I've maxed the size of the output window to see if this strange pattern would still repeat, and the answer is yes:
And my question is:
Does anybody know why appears this pattern in "," between the Integers from the list? Shouldn't it be more random and less like elipses?