This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A038791 #27 Jul 12 2025 18:51:19 %S A038791 2,4,12,104,344,4096,14572,190652,9586984,35791472,1908874584, %T A038791 27487790720,104715393912,1529755308212,86607685141744, %U A038791 4969489243995032,19215358410149344,1117984489315857512,16865594581677305360,65588423373189982912 %N A038791 An intermediate sequence for nonisomorphic circulant p^2-tournaments, indexed by odd primes p. %C A038791 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 %C A038791 Also : Number of subsets of {1, ..., p} with product = -1 mod p, where p is the n-th prime. - _Ridouane Oudra_, Jul 08 2025 %H A038791 Charles R Greathouse IV, <a href="/A038791/b038791.txt">Table of n, a(n) for n = 2..100</a> %H A038791 M. Klin, V. A. Liskovets and R. Poeschel, <a href="http://www.mat.univie.ac.at/~slc/wpapers/s36klp.html">Analytical enumeration of circulant graphs with prime-squared vertices</a>, Sem. Lotharingien de Combin., B36d, 1996, 36 pages. %F A038791 a(p^2) = A038790(p^2) - A038789(p^2) + A038792(p^2). %F A038791 a(n) = A238446(n) + 1. - _Ridouane Oudra_, Jul 08 2025 %t A038791 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]]]; %t A038791 a[n_] := has[Prime[n]]; %t A038791 Table[a[n], {n, 2, 21}] (* _Jean-François Alcover_, Aug 30 2019, after _Charles R Greathouse IV_ *) %o A038791 (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] %o A038791 a(n)=has(prime(n)) \\ _Charles R Greathouse IV_, Jun 06 2013 %Y A038791 Cf. A038787, A238446. %K A038791 nonn,easy %O A038791 2,1 %A A038791 _N. J. A. Sloane_, May 04 2000 %E A038791 More terms from _Valery A. Liskovets_, May 09 2001 %E A038791 a(12)-a(20) from _Charles R Greathouse IV_, Jun 06 2013