Extension of Fibonacci numbers to negative numbers, what does it mean?
Task: Define two Haskell functions (recursive and using list comprehensions) by variants.
Tell me what it means to expand Fibonacci numbers to negative numbers?
f(0)=1
f(1)=1
f(2)=f(0)+f(1)
...
f(n)=f(n-2)+f(n-1)
To be extended to negative numbers? Instead of f(n)=f(n-2)+f(n-1) we use f(n)=f(n+2)-f(n+1) and go "from top to bottom":
f(-1) =f(1)-f(0)=0
f(-2)=f(0)-f(-1)=1
f(-3)=f(-1)-f(-2)=-1
f(-4)=f(-2)-f(-3)=2
...