OFFSET
0,2
COMMENTS
For n > 0, a(n) is prime or pseudoprime (a Fermat pseudoprime to base 3).
Conjecture: a(n) is prime for every n > 0, namely a(n) is the smallest prime p > a(n-1) different from 3 such that 3^(p-1) == 1 (mod a(n-1)), with a(0) = 1.
Generally: for a fixed integer base b > 1, a(n) is the smallest k > a(n-1) such that b^(k-1) == 1 (mod a(n-1)*k), with a(0) = 1. For n > 0, a(n) is prime or pseudoprime (a Fermat pseudoprime to base b). If for a base b, a(n) is a prime for every n > 0, then a(n) is the smallest prime p > a(n-1) that does not divide b such that b^(p-1) == 1 (mod a(n-1)), with a(0) = 1. For any integer base b > 1, a(n) is prime for almost all n. Seems that at most finitely many terms are composite.
MATHEMATICA
A = {1}; While[Length[A] < 500, a = Last[A]; r = MultiplicativeOrder[3, a]; k = a + r; While[PowerMod[3, k - 1, k a] != 1, k = k + r]; AppendTo[A, k]]; Take[A, 75] (* Emmanuel Vantieghem, Mar 31 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Mar 30 2019
EXTENSIONS
a(18)-a(29) from Amiram Eldar, Mar 30 2019
More terms from Emmanuel Vantieghem, Mar 31 2019
STATUS
approved