OFFSET
0,2
EXAMPLE
a(4) = 239 because 239^2+1 = 2*13^4.
MATHEMATICA
b=5; n13=13; jo=Join[{0, b}, Table[n13=13*n13; b=PowerMod[b, 13, n13]; b=Min[b, n13-b], {99}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 04 2012
STATUS
approved