Solution: Last Digit of the Sum of Fibonacci Numbers’ Squares

Solution for the Last Digit of the Sum of the Squares of Fibonacci Numbers Problem.

We'll cover the following

Solution

The table below shows the 11 Fibonacci numbers and the 11 numbers Sn=F02+F12++Fn2S_n = F_0^2 +F_1^2 +\cdot \cdot \cdot+F_n^2.

nn 1 1 2 3 4 5 6 7 8 9 10
FnF_n 0 1 1 2 3 5 8 13 21 34 55
SnS_n 0 1 2 6 15 40 104 273 714 1870 4895

We see that Sn=FnFn+1S_n = F_n \cdot F_{n+1}. Therefore, we just find the last digit of FnFn+1F_n \cdot F_{n+1} by applying the Pisano period method.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.