OFFSET
1,2
COMMENTS
a(n) mod 20 = 10 for n >= 3. - G. C. Greubel, Nov 05 2018
This sequence is infinite, because for n > 1, 3^a(n) + 1 is in this sequence. - Jinyuan Wang, Nov 06 2018
For the provided data, if k is a term then p*k is a term where p is an odd divisor of k. - David A. Corneth, Nov 06 2018
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..180 (first 100 terms from G. C. Greubel)
MATHEMATICA
Do[If[PowerMod[3, n, n] + 1 == n, Print[n]], {n, 1, 10^7}] (* Jinyuan Wang, Nov 01 2018 *)
PROG
(PARI) for(n=1, 10^7, if(Mod(3, n)^n==-1, print1(n, ", "))) \\ Jinyuan Wang, Nov 01 2018
(Magma) [n: n in [1..2*10^7]| Modexp(3, n, n)+1 eq n]; // Vincenzo Librandi, Nov 01 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected by David W. Wilson
STATUS
approved