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.

A046147 Triangle read by rows in which row n lists the primitive roots mod n (omitting numbers n without a primitive root).

This page as a plain text file.
%I A046147 #35 Feb 16 2025 08:32:38
%S A046147 1,2,3,2,3,5,3,5,2,5,3,7,2,6,7,8,2,6,7,11,3,5,3,5,6,7,10,11,12,14,5,
%T A046147 11,2,3,10,13,14,15,7,13,17,19,5,7,10,11,14,15,17,19,20,21,2,3,8,12,
%U A046147 13,17,22,23,7,11,15,19,2,5,11,14,20,23,2,3,8,10,11,14,15,18,19,21,26
%N A046147 Triangle read by rows in which row n lists the primitive roots mod n (omitting numbers n without a primitive root).
%H A046147 T. D. Noe, <a href="/A046147/b046147.txt">Table of n, a(n) for n = 2..3119</a> (first 99 nonempty rows of triangle, flattened)
%H A046147 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimitiveRoot.html">Primitive Root.</a>
%e A046147 n followed by primitive roots, if any:
%e A046147 1 -
%e A046147 2 1
%e A046147 3 2
%e A046147 4 3
%e A046147 5 2 3
%e A046147 6 5
%e A046147 7 3 5
%e A046147 8 -
%e A046147 9 2 5
%e A046147 10 3 7
%e A046147 11 2 6 7 8
%e A046147 12 -
%e A046147 13 2 6 7 11
%e A046147 ...
%p A046147 f:= proc(n) local p,k,m,R;
%p A046147      p:= numtheory:-primroot(n);
%p A046147      if p = FAIL then return NULL fi;
%p A046147      m:= numtheory:-phi(n);
%p A046147      k:= select(i -> igcd(i,m) = 1, [$1..m-1]);
%p A046147      op(sort(map(t -> p&^t mod n, k)))
%p A046147 end proc:
%p A046147 f(2):= 1:
%p A046147 map(f, [$2..50]); # _Robert Israel_, Apr 28 2017
%t A046147 a[n_] := Select[Range[n-1], GCD[#, n] == 1 && MultiplicativeOrder[#, n] == EulerPhi[n]& ]; Table[a[n], {n, 1, 30}] // Flatten (* _Jean-François Alcover_, Oct 23 2012 *)
%t A046147 PrimitiveRootList[Range[Prime[10]]]//Flatten (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 10 2016 *)
%o A046147 (PARI) a_row(r) = my(v=[], phi=eulerphi(r)); for(i=1, r-1, if(1 == gcd(r, i) && phi == znorder(Mod(i, r)), v=concat(v, i))); v \\ _Ruud H.G. van Tol_, Oct 23 2023
%Y A046147 Cf. A001918, A046144 (row lengths), A046145, A046146.
%Y A046147 Cf. A060749, A306252 (1st column), A306253 (last/maximum element)
%K A046147 nonn,tabf
%O A046147 2,2
%A A046147 _Eric W. Weisstein_
%E A046147 Edited by _Robert Israel_, Apr 28 2017