Problem 56393. Easy Sequences 77: Powers of Fibonacci Numbers
Given integers x and n, we are asked to evaluate the following function:
. That is, P equals x raised to the power of the n-th Fibonacci number. We define
as follows:
and
for
.
Example:
.
Please reduce the output, modulo
.
------------------------
HINT: One solution is already shown, however java math is not allowed.
Solution Stats
Problem Comments
-
3 Comments
David Hill
on 19 Oct 2022
Test 10 is wrong. I ran your algorithm using java math and obtained:
s=[1021322 1048348 1452207 670027] which is the same figures I obtained using my algorithm. My algorithm passes all the other tests.
Ramon Villamangca
on 20 Oct 2022
Hi David, I have not accounted for Fibonacci of 0 which is 0, which is required in my algorithm. Please try again.
GeeTwo
on 17 Dec 2022
Surprisingly easy once you see a couple of tricks.
Solution Comments
Show commentsProblem Recent Solvers3
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3059 Solvers
-
Find state names that start with the letter N
1428 Solvers
-
Project Euler: Problem 9, Pythagorean numbers
1432 Solvers
-
Sort numbers by outside digits
158 Solvers
-
Iterate the sum of divisors and totient
17 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!