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.

Showing 1-10 of 10 results.

A002230 Primes with record values of the least positive primitive root.

Original entry on oeis.org

2, 3, 7, 23, 41, 71, 191, 409, 2161, 5881, 36721, 55441, 71761, 110881, 760321, 5109721, 17551561, 29418841, 33358081, 45024841, 90441961, 184254841, 324013369, 831143041, 1685283601, 6064561441, 7111268641, 9470788801, 28725635761, 108709927561, 386681163961, 1990614824641, 44384069747161, 89637484042681
Offset: 1

Views

Author

Keywords

References

  • R. Osborn, Tables of All Primitive Roots of Odd Primes Less Than 1000, Univ. Texas Press, 1961.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • 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.

Crossrefs

Cf. A002229 (for the primitive roots in question).
Records in A023048, indices in A114885.

Programs

  • Mathematica
    s = {2}; rm = 1; Do[p = Prime[k]; r = PrimitiveRoot[p]; If[r > rm, Print[p]; AppendTo[s, p]; rm = r], {k, 10^6}]; s (* Jean-François Alcover, Apr 05 2011 *)
    DeleteDuplicates[Table[{p,PrimitiveRoot[p,1]},{p,Prime[Range[61100]]}],GreaterEqual[ #1[[2]],#2[[2]]]&][[All,1]] (* The program generates the first 15 terms of the sequence. *) (* Harvey P. Dale, Aug 22 2022 *)
  • Python
    from sympy import isprime, primitive_root
    from itertools import count, islice
    def f(n): return 0 if not isprime(n) or (r:=primitive_root(n))==None else r
    def agen(r=0): yield from ((m, r:=f(m))[0] for m in count(1) if f(m) > r)
    print(list(islice(agen(), 15))) # Michael S. Branicky, Feb 13 2023

Extensions

More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

A066529 a(n) is the least index such that the least primitive root of the a(n)-th prime is n, or zero if no such prime exists.

Original entry on oeis.org

1, 2, 4, 0, 9, 13, 20, 0, 0, 65, 117, 566, 88, 173, 85, 0, 64, 5426, 43, 10217, 80, 474, 326, 44110, 0, 1479, 0, 12443, 1842, 11662, 775, 0, 23559, 5029, 6461, 0, 3894, 5629, 15177, 105242, 14401, 182683, 9204, 7103, 5518399, 23888, 24092, 42304997, 0, 1455704, 27848, 12107, 14837, 205691645, 38451, 12102037, 39370, 28902, 57481, 56379, 90901, 53468, 5918705, 0, 732055, 1738826, 242495, 265666, 10523, 388487, 260680
Offset: 1

Views

Author

Wouter Meeussen, Jan 06 2002

Keywords

Comments

The corresponding primes are in A023048.
For n < 150, only a(108) is presently unknown. - Robert G. Wilson v, Jan 03 2006

Examples

			a(6) = 13 because Prime[13] = 41 is the least prime with least primitive root = 6
		

Crossrefs

Programs

  • Mathematica
    big = Table[ p = Prime[ n ]; PrimitiveRoot[ p ], {n, 1, 1000000} ]; Flatten[ Table[ Position[ big, n, 1, 1 ]/.{}-> 0, {n, 79} ] ] (* First load package NumberTheory`NumberTheoryFunctions` *)
    (* first load package *) << NumberTheory`NumberTheoryFunctions` (* then do *) t = Table[0, {100}]; Do[a = PrimitiveRoot@Prime@n; If[a < 101 && t[[a]] == 0, t[[a]] = n], {n, 10^6}]; t (* Robert G. Wilson v, Dec 15 2005 *)

Formula

a(n) = 0 iff n is a perfect power (A001597) > 1. - Robert G. Wilson v, Jan 03 2006
a(n) = min { k | A001918(k) = n } U {0} = A000720(A023048(n)) (or zero). - M. F. Hasler, Jun 01 2018

Extensions

Edited by Dean Hickerson, Jan 14 2002
Further terms from Robert G. Wilson v, Jan 03 2006

A133432 Let m = n-th number that is not a perfect power, A007916(n). Then a(n) = smallest prime having least positive primitive root m.

Original entry on oeis.org

3, 7, 23, 41, 71, 313, 643, 4111, 457, 1031, 439, 311, 53173, 191, 107227, 409, 3361, 2161, 533821, 12391, 133321, 15791, 124153, 5881, 268969, 48889, 64609, 36721, 55441, 166031, 1373989, 156601, 2494381, 95471, 71761, 95525767
Offset: 1

Views

Author

N. J. A. Sloane, Nov 29 2007

Keywords

Comments

a(n) = A023048(A007916(n)).

Crossrefs

Cf. A023048, A007916, A001597, A133433 (records).

Extensions

Definition corrected by Christopher J. Smyth, Oct 16 2013

A133433 Records in A133432.

Original entry on oeis.org

3, 7, 23, 41, 71, 313, 643, 4111, 53173, 107227, 533821, 1373989, 2494381, 95525767, 823766851, 4348468741, 226547941621, 596653488817, 5260410488191
Offset: 1

Views

Author

N. J. A. Sloane, Nov 29 2007

Keywords

Comments

Also with an initial 2, records in A023048. The next term, which exceeds 10^14, is A023048(108) if it is not 0 (i.e., if there does exist a prime whose smallest primitive root is 108, then it is larger than 10^14). - Jianing Song, Aug 01 2018

Crossrefs

A214158 Smallest number with n as least nonnegative primitive root, or 0 if no such number exists.

Original entry on oeis.org

1, 2, 3, 4, 0, 6, 41, 22, 0, 0, 313, 118, 4111, 457, 1031, 439, 0, 262, 53173, 191, 107227, 362, 3361, 842, 533821, 0, 12391, 0, 133321, 2906, 124153, 2042, 0, 3062, 48889, 2342, 0, 7754, 55441, 19322, 1373989, 3622, 2494381, 16022, 71761, 613034, 273001, 64682, 823766851, 0, 23126821, 115982, 129361, 29642
Offset: 0

Views

Author

Arkadiusz Wesolowski, Jul 05 2012

Keywords

Comments

a(A001597(n)) = 0 for n > 1.

Examples

			a(7) = 22, since 22 has 7 as smallest positive primitive root and no number < 22 has 7 as smallest positive primitive root.
		

Crossrefs

Programs

  • Mathematica
    lst2 = {}; r = 47; smallestPrimitiveRoot[n_ /; n <= 1] = 0; smallestPrimitiveRoot[n_] := Block[{pr = PrimitiveRoot[n], g}, If[! NumericQ[pr], g = 0, g = 1; While[g <= pr, If[CoprimeQ[g, n] && MultiplicativeOrder[g, n] == EulerPhi[n], Break[]]; g++]]; g]; lst1 = Union[Flatten@Table[n^i, {i, 2, Log[2, r]}, {n, 2, r^(1/i)}]]; Do[n = 2; If[MemberQ[lst1, l], AppendTo[lst2, 0], While[True, If[smallestPrimitiveRoot[n] == l, AppendTo[lst2, n]; Break[]]; n++]], {l, r}]; Prepend[lst2, 1] (* Most of the code is from Jean-François Alcover *)

A083701 Smallest prime having Fibonacci(n) as least primitive root, or 0 if no such prime exists.

Original entry on oeis.org

2, 2, 3, 7, 23, 0, 457, 409, 48889, 459841, 6366361
Offset: 1

Views

Author

Sven Simon, May 04 2003

Keywords

Comments

Next term >= 276000000. - Robert G. Wilson v, May 12 2003

Examples

			a(8) = 409 because 409 is the first prime having Fibonacci(8) = 21 as least primitive root
		

Crossrefs

Programs

  • Mathematica
    << NumberTheory`NumberTheoryFunctions`; a = Table[ Fibonacci[i], {i, 2, 20}]; b = Table[0, {20}]; k = 1; Do[k = NextPrime[k]; j = FromDigits[ Flatten[ Position[ a, PrimitiveRoot[k]]]]; If[ b[[j]] == 0, b[[j]] = k], {n, 1, 10^6}]; b

Formula

a(n) = A023048(A000045(n)). - Jianing Song, Oct 31 2018

Extensions

Offset 1 from Michel Marcus, Oct 30 2018

A079060 Least k such that the least positive primitive root of prime(k) equals prime(n).

Original entry on oeis.org

2, 4, 9, 20, 117, 88, 64, 43, 326, 1842, 775, 3894, 14401, 9204, 24092, 14837, 57481, 90901, 242495, 260680, 61005, 508929, 1084588, 436307, 1124509, 1824015, 2969632, 2052357, 4006960, 5241202, 10253662, 30802809, 17480124, 73915355, 98931475, 42664033
Offset: 1

Views

Author

Benoit Cloitre, Feb 02 2003

Keywords

Comments

a(49) = 1247136427. For n > 45, a(n) > 1.5*10^9 except n = 49. - David A. Corneth, Feb 15 2023

Crossrefs

Programs

  • PARI
    a(n) = {my(p=prime(n), s=1); while(p!=lift(znprimroot(prime(s))), s++); s; } \\ Modified by Jinyuan Wang, Apr 03 2020
    
  • PARI
    upto(u, {maxn = 100}) = { my(t = 1, m = Map(), res = []); forprime(p = 2, oo, mapput(m, p, t); t++; if(t > maxn, break ) ); t = 1; u = prime(u); forprime(p = 2, u, c = lift(znprimroot(p)); if(mapisdefined(m, c), ind = mapget(m, c); if(ind > #res, res = concat(res, vector(ind - #res)) ); if(res[ind] == 0, res[ind] = t; ) ); t++ ); res } \\ David A. Corneth, Feb 15 2023
    
  • Python
    from sympy import nextprime, primitive_root
    def a(n):
        k, pk, pn = 1, 2, prime(n)
        while primitive_root(pk) != pn: k += 1; pk = nextprime(pk)
        return k
    print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Feb 13 2023
    
  • Python
    # faster version for segments of sequence
    from itertools import count, islice
    from sympy import isprime, nextprime, prime, primepi, primitive_root
    def agen(startk=1, startn=1): # generator of terms
        p, vdict, adict, n = prime(startk), dict(), dict(), startn
        for k in count(startk):
            v = primitive_root(p)
            if v not in vdict and isprime(v):
                vdict[v] = k
                adict[primepi(v)] = k
            while n in adict: yield adict[n]; n += 1
            p = nextprime(p)
    print(list(islice(agen(), 18))) # Michael S. Branicky, Feb 14 2023

Extensions

a(17)-a(18) from Jinyuan Wang, Apr 03 2020
a(19)-a(36) from Michael S. Branicky, Feb 14 2023

A079061 Smallest prime p such that the least positive primitive root of p equals prime(n).

Original entry on oeis.org

3, 7, 23, 71, 643, 457, 311, 191, 2161, 15791, 5881, 36721, 156601, 95471, 275641, 161831, 712321, 1171921, 3384481, 3659401, 760321, 7510801, 16889161, 6366361, 17551561, 29418841, 49443241, 33358081, 67992961, 90441961, 184254841
Offset: 1

Views

Author

Benoit Cloitre, Feb 02 2003

Keywords

Comments

Smallest prime(m) such that A001918(m) = prime(n). (Corrected by Jonathan Sondow, Feb 03 2013)
a(36) = 831143041 and a(34) and a(35) > 1065000000. - Robert G. Wilson v, Jul 03 2003

Crossrefs

Programs

  • Mathematica
    << NumberTheory`NumberTheoryFunctions`; a = Table[ 0, {36}]; p = 2; Do[p = NextPrime[p]; pr = PrimitiveRoot[p]; If[ PrimeQ[pr] && PrimePi[pr] < 37 && a[[ PrimePi[pr]]] == 0, a[[ PrimePi[ pr]]] = p], {n, 2, 54000000}]; a
  • PARI
    a(n)=if(n<0,0,s=1; while(prime(n)!=lift(znprimroot(prime(s))),s++); prime(s))

Formula

a(n) = A023048(prime(n)). - R. J. Mathar, Aug 03 2018

Extensions

More terms from Robert G. Wilson v, Jul 03 2003

A259484 Smallest nonprime number having least positive primitive root n, or 0 if no such root exists.

Original entry on oeis.org

1, 0, 9, 4, 0, 6, 1681, 22, 0, 0, 97969, 118, 16900321, 914, 1062961, 542, 0, 262, 2827367929, 382
Offset: 0

Views

Author

Robert G. Wilson v, Jun 28 2015

Keywords

Comments

The value 0 at indices 4, 8, 9, 16, ..., says 0 has no primitive roots (A001597), but the 0 at index 1 says 1 has a primitive root of 0, the only real 0 in the sequence.
a(n) cannot be 2, 4, the odd power of a prime or twice the odd power of a prime.
Conjecture: each odd-indexed value will be populated before either of its even-indexed neighbors.

Examples

			a(2) = 9 because the least primitive root of the nonprime number 9 is 2 and no nonprime less than 9 meets this criterion.
		

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.

Crossrefs

Programs

  • Mathematica
    smallestPrimitiveRoot[n_ /; n <= 1] = 0; smallestPrimitiveRoot[n_] := Block[{pr = PrimitiveRoot[n], g}, If[ !NumericQ[pr], g = 0, g = 1; While[g <= pr, If[ CoprimeQ[g, n] && MultiplicativeOrder[g, n] == EulerPhi[n], Break[]]; g++]]; g]; (* This part of the code is from Jean-François Alcover as found in A046145, Feb 15 2012 *)
    t = Table[-1, {1000}];  ppQ[n_] := GCD @@ Last /@ FactorInteger@ n > 1; ppQ[1] = True; k = 1; While[ k < 1001, If[ ppQ@ k, t[[k]] = 0]; k++]; k = 1; While[k < 200000001, If[ !PrimeQ[k], a = smallestPrimitiveRoot[k]; If[ t[[a]] == -1, t[[a]] = k]]; k++]; t

Formula

a(n) = 0 if n is a perfect power (A001597).

Extensions

a(18)-a(19) from Robert G. Wilson v, Sep 26 2015

A318239 a(n) is the smallest primitive root of A133433(n).

Original entry on oeis.org

2, 3, 5, 6, 7, 10, 11, 12, 18, 20, 24, 40, 42, 45, 48, 54, 72, 80, 96
Offset: 1

Views

Author

Jianing Song, Aug 22 2018

Keywords

Comments

Also with an initial 1, numbers k such that A023048(k) set a new record.
If A023048(108) != 0 (which is implied assuming generalized Artin's conjecture) then the next term of this sequence is 108.
Conjecturally 11 is the largest prime in this sequence, 42 is the largest squarefree term, and 45 is the largest odd term.

Examples

			The smallest prime with least primitive root 11 is 643, and the smallest prime with least primitive root 2, 3, 5, ..., 10 are all < 643, so 11 is a term.
The smallest prime with least primitive root 45 is 95525767, and the smallest prime with least primitive root 2, 3, 5, ..., 44 are all < 95525767, so 45 is a term.
13 is not a term since the smallest prime with least primitive root 13 is 457, but the smallest prime with least primitive root 12 is 4111, which is larger than 457.
		

Crossrefs

Showing 1-10 of 10 results.