login
A064131
Number of divisors of 3^n + 1 that are relatively prime to 3^m + 1 for all 0 < m < n.
6
2, 3, 2, 2, 2, 2, 2, 2, 4, 4, 2, 4, 2, 2, 4, 4, 2, 8, 2, 4, 2, 4, 4, 2, 8, 4, 4, 4, 4, 8, 2, 4, 2, 4, 4, 2, 2, 8, 4, 16, 4, 4, 4, 2, 8, 4, 4, 8, 4, 4, 8, 8, 4, 4, 2, 4, 8, 8, 4, 4, 8, 4, 8, 16, 2, 2, 2, 4, 8, 32, 8, 32, 4, 4, 8, 16, 16, 2, 4, 8, 8, 32, 8, 16, 32, 8, 32, 32, 8, 8, 4
OFFSET
0,1
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