How to get the period of oeis.org/A130166 other than by trail?

112 Views Asked by At

oeis.org/A130166 a(0)=1; a(n)=prime(mod(a(n-1),1000)) starts with:

1, 2, 3, 5, 11, 31, 127, 709, 5381, 2621, 4591, 4327, 2179, 1063, 307, 2027, 103, 563, 4091, 467, 3319, 2113, 617, 4549, 3967, 7607, 4463, 3299, 1979, 7717, 5431, 3001, 2,...

The comments say: Starting with the second term, cycles every 31 terms.

Is it possible to get the period of a(n) other than by trial?