Fun problem, requires 3 facts.
(1) and (2) can be found on the Pisano Period Wikipedia page. The proof for (1) is simple, and (2) is conjectured to be true. (3) is extremely simple since if the period is of length n then that means Fn (mod p) = 0.
With these we can solve the problem by finding all primes such that π(p) divides n and then generating the multiples of all these numbers and checking if their period if equal to n.
A sketch of the algorithm is as follows:
Initialize 3 arrays
primes which will store the primes such that π(p) divides n
pivalues which will store π(p)
multiplicities which will store the highest power of p, e, such that π(p^e) divides n
Find the prime factors of Fn
For each prime factor p of Fn calculate π(p)
If π(p) divides n
Store p in primes
Store π(p) in pivalues
Find maximum e such that π(p^e) divides n and store it in multiplicities
Generate all multiples of the primes stored in primes up to their maximum multiplicities stored in multiplicities together with their corresponding period
Go through multiples and sum all numbers with period equal to n
The hardest part was to make an efficient multiples generator. I used recursion, I include the snippet of this function below.
Input 2 integers seperated by a space (n, limit)
Code will output the sum of all numbers, x < limit, such that π(x) = n