For this challenge, you are to output the result of the sum of some numbers. What are these numbers? Well, you are given input, (a
, b
), which are integers (positive, negative, or zero) , a != b
, and a < b
, and each integer within a
and b
(including them) will have exponents according to the Fibonacci numbers. That's confusing so here's an example:
Input: (-2, 2)
Output: -2**1 + (-1**1) + 0**2 + 1**3 + 2**5 =
-2 + -1 + 0 + 1 + 32 = 30
Given that the first Fibonacci number is represented by f(0)
, the formula is:
a**f(0) + ... + b**f(b-a+1)
Input, Processing, Output
To clarify the above, here are some test cases, the processing of the input, and the expected outputs:
Input: (1, 2)
Processing: 1**1 + 2**1
Output: 3
Input: (4, 8)
Processing: 4**1 + 5**1 + 6**2 + 7**3 + 8**5
Output: 33156
Input: (-1, 2)
Processing: -1**1 + 0**1 + 1**2 + 2**3
Output: 8
Input: (-4, -1)
Processing: -4**1 + -3**1 + -2**2 + -1**3
Output: -4
Rules
No standard loopholes allowed
Exponents must be in order according to Fibonacci series
Code must work for above test cases
Only the output needs to be returned
Winning Criteria
Shortest code wins!
0
is not included in the fibonacci numbers here? \$\endgroup\$