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-4 of 4 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)

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

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