login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023048 Smallest prime having least positive primitive root n, or 0 if no such prime exists. 11
2, 3, 7, 0, 23, 41, 71, 0, 0, 313, 643, 4111, 457, 1031, 439, 0, 311, 53173, 191, 107227, 409, 3361, 2161, 533821, 0, 12391, 0, 133321, 15791, 124153, 5881, 0, 268969, 48889, 64609, 0, 36721, 55441, 166031, 1373989, 156601, 2494381, 95471, 71761, 95525767 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) = 0 iff n is a perfect power m^k, m >= 1, k >= 2 (i.e., a member of A001597).
Of course if n is a perfect power then a(n) = 0, but it seems that the other direction is true only assuming the generalized Artin's conjecture. See the link from Tomás Oliveira e Silva below. - Jianing Song, Jan 22 2019
REFERENCES
A. E. Western and J. C. P. Miller, Tables of Indices and Primitive Roots. Royal Society Mathematical Tables, Vol. 9, Cambridge Univ. Press, 1968, p. XLIV.
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..107 (from the web page of Tomás Oliveira e Silva)
Tomás Oliveira e Silva, Least primitive root of prime numbers
FORMULA
a(n) = min { prime(k) | A001918(k) = n } U {0} = A000040(A066529(n)) (or zero). - M. F. Hasler, Jun 01 2018
EXAMPLE
a(2) = 3, since 3 has 2 as smallest positive primitive root and no prime p < 3 has 2 as smallest positive primitive root.
a(24) = 533821, since prime 533821 has 24 as smallest positive primitive root and no prime p < 533821 has 24 as smallest positive primitive root.
MATHEMATICA
t = Table[0, {100}]; Do[a = PrimitiveRoot@Prime@n; If[a < 101 && t[[a]] == 0, t[[a]] = n], {n, 10^6}]; Unprotect[Prime]; Prime[0] = 0; Prime@t; Clear[Prime]; Protect[Prime] (* Robert G. Wilson v, Dec 15 2005 *)
PROG
(Python)
from sympy import nextprime, perfect_power, primitive_root
def a(n):
if perfect_power(n): return 0
p = 2
while primitive_root(p) != n: p = nextprime(p)
return p
print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Feb 13 2023
(Python) # faster version for initial segment of sequence
from itertools import count, islice
from sympy import nextprime, perfect_power, primitive_root
def agen(): # generator of terms
p, adict, n = 2, {None: 0}, 1
for k in count(1):
v = primitive_root(p)
if v not in adict:
adict[v] = p
if perfect_power(n): adict[n] = 0
while n in adict: yield adict[n]; n += 1
p = nextprime(p)
print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 13 2023
CROSSREFS
Indices of the primes: A066529.
For records see A133433. See A133432 for a version without the 0's.
Sequence in context: A203143 A249523 A301316 * A083521 A104691 A011160
KEYWORD
nonn
AUTHOR
EXTENSIONS
Comment corrected by Christopher J. Smyth, Oct 16 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 11:45 EDT 2024. Contains 371278 sequences. (Running on oeis4.)