OFFSET
0,1
LINKS
Sam Wagstaff, Cunningham Project, Factorizations of 3^n-1, n odd, n<540
MATHEMATICA
a[0]=2; a[n_] := Length@ Select[Divisors[3^n+1], GCD[Times @@ (3^Range[1, n-1] + 1), #] == 1 &]; Array[a, 91, 0] (* Giovanni Resta, Jul 02 2018 *)
PROG
(PARI) a(n) = if (n==0, 2, sumdiv(3^n+1, d, vecsum(vector(n-1, k, gcd(d, 3^k+1) == 1)) == n-1)); \\ Michel Marcus, Jun 24 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Sep 10 2001
EXTENSIONS
a(1) corrected and extended by Michel Marcus, Jul 02 2018
STATUS
approved