OFFSET
1,3
COMMENTS
LINKS
Jianing Song, Table of n, a(n) for n = 1..7000
FORMULA
For n = 9, 9 is divisible by a^9 + 1 implies a == 2 (mod 3), so a(9) = 2.
For n = 10, 10 is divisible by a^10 + 1 implies a == 3, 7 (mod 10), so a(10) = 3.
For n = 34, 34 is divisible by a^34 + 1 implies a == 13, 21 (mod 34), so a(34) = 13.
PROG
(PARI) a(n) = if(!(n%2)&&!issquare(Mod(-1, n)), 0, my(i=1); while(Mod(i, n)^n!=n-1, i++); i)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Sep 28 2018
STATUS
approved