OFFSET
2,1
COMMENTS
Number of subsets of {1, ..., p} with product = 1 mod p, where p is the n-th prime. - Charles R Greathouse IV, Jun 06 2013
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..100
M. Klin, V. A. Liskovets and R. Poeschel, Analytical enumeration of circulant graphs with prime-squared vertices, Sem. Lotharingien de Combin., B36d, 1996, 36 pages.
MATHEMATICA
has[p_] := Module[{v, u}, v = Table[0, {p-1}]; v[[1]] = 1; For[n = 2, n <= p-1, n++, u = Table[0, {p-1}]; For[j = 1, j <= p-1, j++, u[[Mod[j*n, p]]] += v[[j]]]; v += u]; 2*v[[1]]];
a[n_] := has[Prime[n]];
Table[a[n], {n, 2, 21}] (* Jean-François Alcover, Aug 30 2019, after Charles R Greathouse IV *)
PROG
(PARI) has(p)=my(v=vector(p-1), u); v[1]=1; for(n=2, p-1, u=vector(p-1); for(j=1, p-1, u[j*n%p]+=v[j]); v+=u); 2*v[1]
a(n)=has(prime(n)) \\ Charles R Greathouse IV, Jun 06 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 04 2000
EXTENSIONS
More terms from Valery A. Liskovets, May 09 2001
a(12)-a(20) from Charles R Greathouse IV, Jun 06 2013
STATUS
approved