cp's OEIS Frontend

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.

A382221 Products of primitive roots when n is 2, 4, p^k, or 2p^k (with p an odd prime), for all other n the value is defined to be 1.

This page as a plain text file.
%I A382221 #42 Apr 18 2025 20:52:09
%S A382221 1,1,2,3,6,5,15,1,10,21,672,1,924,15,1,1,11642400,55,163800,1,1,29393,
%T A382221 109681110000,1,64411776,21945,708400,1,5590307923200,1,970377408,1,1,
%U A382221 644812245,1,1,134088514560000,11756745,1,1,138960660963091968000,1
%N A382221 Products of primitive roots when n is 2, 4, p^k, or 2p^k (with p an odd prime), for all other n the value is defined to be 1.
%H A382221 Michael De Vlieger, <a href="/A382221/b382221.txt">Table of n, a(n) for n = 1..838</a>
%H A382221 Wikipedia, <a href="https://en.wikipedia.org/wiki/Primitive_root_modulo_n">Primitive root modulo n</a>.
%F A382221 a(n) = A123475(n) if n is prime.
%F A382221 a(A180634(n)) = 1.
%F A382221 a(n) > 1 if n in A033948.
%t A382221 Table[Times @@ PrimitiveRootList[n], {n, 42}] (* _Michael De Vlieger_, Apr 07 2025 *)
%o A382221 (Python)
%o A382221 from sympy import gcd, primitive_root, totient
%o A382221 def a(n):
%o A382221     try:
%o A382221         g = primitive_root(n)
%o A382221     except ValueError:
%o A382221         return 1
%o A382221     P = 1
%o A382221     if g:
%o A382221         phi = totient(n)
%o A382221         for k in range(1, phi):
%o A382221             if gcd(k, phi) == 1:
%o A382221                 P *= pow(g, k, n)
%o A382221     return P
%o A382221 print([a(n) for n in range(1,43)])
%Y A382221 Cf. A033948, A121380, A123475, A180634.
%K A382221 nonn
%O A382221 1,3
%A A382221 _DarĂ­o Clavijo_, Mar 27 2025