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-5 of 5 results.

A023048 Smallest prime having least positive primitive root n, or 0 if no such prime exists.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

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

Examples

			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.
		

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

Indices of the primes: A066529.
For records see A133433. See A133432 for a version without the 0's.

Programs

  • 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 *)
  • 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

Formula

a(n) = min { prime(k) | A001918(k) = n } U {0} = A000040(A066529(n)) (or zero). - M. F. Hasler, Jun 01 2018

Extensions

Comment corrected by Christopher J. Smyth, Oct 16 2013

A066814 Smallest prime p such that (p-1) has n divisors, or 0 if no such prime exists.

Original entry on oeis.org

2, 3, 5, 7, 17, 13, 0, 31, 37, 113, 0, 61, 0, 193, 401, 211, 65537, 181, 0, 241, 577, 13313, 0, 421, 1297, 12289, 4357, 2113, 0, 1009, 0, 1321, 25601, 2424833, 752734097, 1801, 0, 786433, 495617, 2161, 0, 4801, 0, 15361, 7057, 155189249, 0
Offset: 1

Views

Author

Wouter Meeussen, Jan 20 2002

Keywords

Comments

The only primes p for which p-1 has a prime number of divisors are Fermat primes A019434.

Examples

			a(17)=65537 because DivisorSigma[0,65536]=17.
		

Crossrefs

Programs

  • Mathematica
    it=Table[ p=Prime[ n ]; DivisorSigma[ 0, p-1 ], {n, 400000} ]; Flatten[ Position[ it, #, 1, 1 ]&/@Range[ 100 ]/.{}- > 0 ]

Extensions

Comment clarified by T. D. Noe, Nov 06 2009
Edited by Max Alekseyev, Nov 10 2009

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

A114885 Prime indices with record values of the least positive primitive root.

Original entry on oeis.org

1, 2, 4, 9, 13, 20, 43, 80, 326, 775, 3894, 5629, 7103, 10523, 61005, 355588, 1124509, 1824015, 2052357, 2719588, 5241202, 10253662, 17480124, 42664033, 83470664, 282411553, 328711697, 432040721, 1247136427, 4461350728, 15082139743
Offset: 1

Views

Author

Robert G. Wilson v, Dec 29 2005

Keywords

Crossrefs

Cf. A002229 (for the primitive roots in question), the records themselves are in A066529.
Showing 1-5 of 5 results.