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.

A046146 Largest primitive root modulo n, or 0 if no root exists.

This page as a plain text file.
%I A046146 #30 Feb 16 2025 08:32:38
%S A046146 0,0,1,2,3,3,5,5,0,5,7,8,0,11,5,0,0,14,11,15,0,0,19,21,0,23,19,23,0,
%T A046146 27,0,24,0,0,31,0,0,35,33,0,0,35,0,34,0,0,43,45,0,47,47,0,0,51,47,0,0,
%U A046146 0,55,56,0,59,55,0,0,0,0,63,0,0,0,69,0,68,69,0,0,0,0,77,0,77,75,80,0,0
%N A046146 Largest primitive root modulo n, or 0 if no root exists.
%C A046146 The value 0 at index 0 says 0 has no primitive roots, but the 0 at index 1 says 1 has a primitive root of 0, the only real 0 in the sequence. - Initial terms corrected by _Harry J. Smith_, Jan 27 2005
%C A046146 a(n) is nonzero if and only if n is 2, 4, or of the form p^k, or 2*p^k where p is an odd prime and k>0. - _Tom Edgar_, Jun 02 2014
%H A046146 T. D. Noe, <a href="/A046146/b046146.txt">Table of n, a(n) for n = 0..10000</a>
%H A046146 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimitiveRoot.html">Primitive Root.</a>
%t A046146 f[n_] := Block[{pr = PrimitiveRootList[n]}, If[pr == {}, 0, pr[[-1]]]]; Array[f, 86, 0] (* _Robert G. Wilson v_, Nov 03 2014 *)
%o A046146 (PARI) for(i=0,100,p=0;for(q=1,i-1,if(gcd(q,i)==1&&znorder(Mod(q,i))==eulerphi(i),p=q));print1(p",")) /* _V. Raman_, Nov 22 2012 */
%Y A046146 Cf. A001918, A046144, A046145, A002233, A071894, A219027, A008330, A010554.
%K A046146 nonn
%O A046146 0,4
%A A046146 _Eric W. Weisstein_
%E A046146 Initial terms corrected by _Harry J. Smith_, Jan 27 2005