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.

A002229 Primitive roots that go with the primes in A002230.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 19, 21, 23, 31, 37, 38, 44, 69, 73, 94, 97, 101, 107, 111, 113, 127, 137, 151, 164, 179, 194, 197, 227, 229, 263, 281, 293, 335, 347, 359, 401, 417
Offset: 1

Views

Author

Keywords

References

  • 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. A002230.

Programs

  • Mathematica
    s = {1}; rm = 1; Do[p = Prime[k]; r = PrimitiveRoot[p]; If[r > rm, Print[r]; AppendTo[s, r]; rm = r], {k, 10^6}]; s (* Jean-François Alcover, Apr 05 2011 *)
  • 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))[1] 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)
a(35)-a(38), from McGown and Sorenson, added by Michel Marcus, Jun 29 2022

A081888 Numbers n such that the least positive primitive root of n is larger than the value for all positive numbers smaller than n.

Original entry on oeis.org

1, 3, 4, 6, 22, 118, 191, 362, 842, 2042, 2342, 3622, 16022, 29642, 66602, 110881, 143522, 535802, 5070662, 6252122, 6497402, 10219442, 69069002, 1130187962
Offset: 1

Views

Author

Sven Simon, Mar 30 2003

Keywords

Comments

A081889 gives the primitive roots itself. Difference from A002229, A002230: In consideration of all n having primitive roots. A002229, A002230 only primes.

Crossrefs

Cf. A081889, A002229, A002230. Positions of records of A306252.

Programs

  • Maple
    a306252 := proc(n::integer)
        local r;
        r := numtheory[primroot](n) ;
        if r <> FAIL then
            return r ;
        else
            return -1 ;
        end if;
    end proc:
    A081888 := proc()
        local rec,n,lpr ;
        rec := -1 ;
        for n from 1 do
            lpr := a306252(n) ;
            if lpr > rec then
                printf("%d,\n",n) ;
                rec := lpr ;
            end if;
        end do:
    end proc:
    A081888() ; # R. J. Mathar, Apr 04 2019
  • Mathematica
    nmax = 10^5;
    r[n_] := r[n] = Module[{prl = PrimitiveRootList[n]}, If[prl == {}, -1, prl[[1]]]]; r[1] = 1;
    Reap[Module[{rec = -1, n, lpr}, For[n = 1, n <= nmax, n++, lpr = r[n]; If[lpr > rec, Print[n, " ", lpr]; Sow[n]; rec = lpr]]]][[2, 1]] (* Jean-François Alcover, Jun 19 2023, after R. J. Mathar *)
  • Python
    from sympy import primitive_root
    from itertools import count, islice
    def f(n): r = primitive_root(n); return r if r != None else 0
    def agen(r=0): yield from ((m, r:=f(m))[0] for m in count(1) if f(m) > r)
    print(list(islice(agen(), 18))) # Michael S. Branicky, Feb 13 2023

Formula

Numbers 1, 2, 4, p^m and 2*p^m have primitive roots for odd primes p and m >=1 natural number.

Extensions

a(24) from Michael S. Branicky, Feb 20 2023

A081889 Least primitive root corresponding to A081888(n).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 19, 21, 23, 31, 35, 41, 43, 53, 57, 69, 87, 93, 95, 101, 115, 141, 173, 203
Offset: 1

Views

Author

Sven Simon, Mar 30 2003

Keywords

Crossrefs

Programs

  • Python
    from sympy import primitive_root
    from itertools import count, islice
    def f(n): r = primitive_root(n); return r if r != None else 0
    def agen(r=0): yield from ((m, r:=f(m))[1] for m in count(1) if f(m) > r)
    print(list(islice(agen(), 18))) # Michael S. Branicky, Feb 13 2023

Extensions

a(24) from Michael S. Branicky, Feb 20 2023

A029932 Primes with record values of the least positive prime primitive root.

Original entry on oeis.org

3, 7, 23, 41, 109, 191, 271, 2791, 11971, 31771, 190321, 2080597, 3545281, 4022911, 73189117, 137568061, 443571241, 565822531, 1160260711, 1622723341, 31552100581, 81651092041, 96736641541, 1867622877121, 5000346134911
Offset: 1

Views

Author

Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

Keywords

Comments

Other terms in the sequence: 39227234631271, 66597722601061 and 84054326426071 -Herman Jamke (hermanjamke(AT)fastmail.fm), Feb 19 2008
Subsequence of A002230, considering only prime primitive roots. - M. F. Hasler, Jun 01 2018

References

  • R. Osborn, Tables of All Primitive Roots of Odd Primes Less Than 1000, Univ. Texas Press, 1961.
  • 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. XLV.

Crossrefs

Programs

  • Mathematica
    (* This program is not suitable for computing more than a dozen terms. *) max = 10^8; pprQ[r_, p_] := Union[Table[PowerMod[r, i, p], {i, 1, p+1}]] == coprimes; ppr[p_] := With[{spr = PrimitiveRoot[p]}, If[PrimeQ[spr], spr, coprimes = Select[Range[p-1], CoprimeQ[#, p]&]; For[r = NextPrime[ spr], True, r = NextPrime[r], If[pprQ[r, p], Return[r]]]]]; Reap[ For[ record=1; p=3, p record, record = ppr1; Print["p = ", p, " ppr = ", record]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Feb 25 2016 *)

Extensions

Corrected by Jud McCranie, Jan 04 2001
2 more terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Feb 19 2008

A124111 Primes with record large values of the second smallest positive primitive root.

Original entry on oeis.org

5, 7, 11, 23, 31, 191, 409, 1151, 2161, 2689, 3361, 4729, 9601, 14281, 23209, 31249, 33049, 55441, 71761, 110881, 2116921, 3384481, 5109721, 222855361, 288940681, 567719161, 831143041, 899978641
Offset: 1

Views

Author

Ken Takusagawa, Nov 27 2006

Keywords

Comments

Sequence begins at the first prime with at least 2 primitive roots, namely 5.

Examples

			The smallest two positive primitive roots of a(26)=567719161 are 43 and 172. No integer less than 567719161 has a second root greater than or equal to 172.
		

Crossrefs

Cf. A002230.
Showing 1-5 of 5 results.