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.

Previous Showing 31-40 of 96 results. Next

A103309 Smallest prime primitive root of n that is less than n, or 0 if none exists.

Original entry on oeis.org

0, 0, 0, 2, 3, 2, 5, 3, 0, 2, 3, 2, 0, 2, 3, 0, 0, 3, 5, 2, 0, 0, 7, 5, 0, 2, 7, 2, 0, 2, 0, 3, 0, 0, 3, 0, 0, 2, 3, 0, 0, 7, 0, 3, 0, 0, 5, 5, 0, 3, 3, 0, 0, 2, 5, 0, 0, 0, 3, 2, 0, 2, 3, 0, 0, 0, 0, 2, 0, 0, 0, 7, 0, 5, 5, 0, 0, 0, 0, 3, 0, 2, 7, 2, 0, 0, 3, 0, 0, 3, 0, 0, 0, 0, 5, 0, 0, 5, 3, 0, 0, 2, 0, 5, 0
Offset: 0

Views

Author

Harry J. Smith, Jan 29 2005

Keywords

Comments

Differs from A046145 only for indices n = 2, 41, 109, 151, 229, ...; see A103335. - Jeppe Stig Nielsen, Mar 06 2020

Crossrefs

Programs

  • Maple
    F:= proc(n)
      local r;
      r:= numtheory:-primroot(n);
      while r::integer and not isprime(r) do
        r:= numtheory:-primroot(r,n);
      od:
      if r = FAIL then 0 else r fi
    end proc:
    seq(F(n),n=0..200); # Robert Israel, May 18 2015
  • Mathematica
    a[n_] := SelectFirst[PrimitiveRootList[n], PrimeQ[#] && # < n&] /. Missing["NotFound"] -> 0;
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Nov 15 2017 *)

A103310 Largest prime primitive root of n that is less than n, or 0 if none exists.

Original entry on oeis.org

0, 0, 0, 2, 3, 3, 5, 5, 0, 5, 7, 7, 0, 11, 5, 0, 0, 11, 11, 13, 0, 0, 19, 19, 0, 23, 19, 23, 0, 19, 0, 17, 0, 0, 31, 0, 0, 19, 29, 0, 0, 29, 0, 29, 0, 0, 43, 43, 0, 47, 47, 0, 0, 41, 47, 0, 0, 0, 47, 47, 0, 59, 53, 0, 0, 0, 0, 61, 0, 0, 0, 67, 0, 59, 61, 0, 0, 0, 0, 59, 0, 59, 71, 79, 0, 0, 73
Offset: 0

Views

Author

Harry J. Smith, Jan 29 2005

Keywords

Crossrefs

Programs

  • Maple
    hasproot:= proc(n)
      if n::odd then nops(numtheory:-factorset(n))=1
      else padic:-ordp(n,2)=1 and nops(numtheory:-factorset(n/2))=1
      fi
    end proc;
    hasproot(2):= true: hasproot(4):= true:
    f:= proc(n) local p,t;
      if not hasproot(n) then return 0 fi;
      t:= numtheory:-phi(n);
      p:= prevprime(n);
      while not numtheory:-order(p,n)=t do
        if p = 2 then return 0 fi;
        p:= prevprime(p);
      od;
      p
    end proc:
    f(0):= 0: f(1):= 0: f(2):= 0:
    map(f, [$0..100]); # Robert Israel, Sep 08 2020
  • Mathematica
    a[n_] := Module[{R = PrimitiveRootList[n], s}, s = Select[R, # < n && PrimeQ[#]&]; If[s == {}, 0, s[[-1]]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 01 2023 *)

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

A103335 Numbers whose smallest primitive root (A046145) is not prime.

Original entry on oeis.org

1, 2, 41, 109, 151, 229, 251, 271, 313, 337, 362, 367, 409, 439, 542, 626, 674, 733, 761, 818, 878, 971, 991, 1021, 1031, 1069, 1289, 1297, 1303, 1429, 1471, 1489, 1681, 1759, 1783, 1789, 1811, 1871, 1873, 1879, 2062, 2137, 2342, 2411, 2441, 2551, 2594
Offset: 1

Views

Author

Harry J. Smith, Jan 31 2005

Keywords

Crossrefs

Programs

  • Maple
    filter:= proc(n)
      local r;
      r:= numtheory:-primroot(n);
      r <> FAIL and not isprime(r)
    end proc:
    filter(1):= true:
    select(filter, [$1..3000]); Robert Israel, Sep 08 2020
  • Mathematica
    L = {}; Do[ If[!PrimeQ[ Min[ Select[ Range[n], CoprimeQ[#, n] && MultiplicativeOrder[#, n] == CarmichaelLambda[n] &]]],
    L = Append[L, n]], {n, 1, 3000}]; L (* Jonathan Sondow, May 17 2017 *)

Extensions

Offset changed by Robert Israel, Sep 08 2020

A002199 Least negative primitive root of n-th prime.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 3, 4, 2, 2, 7, 2, 6, 9, 2, 2, 3, 2, 4, 2, 5, 2, 3, 3, 5, 2, 2, 3, 6, 3, 9, 3, 3, 4, 2, 5, 5, 4, 2, 2, 3, 2, 2, 5, 2, 2, 4, 9, 3, 6, 3, 2, 7, 3, 3, 2, 2, 2, 5, 3, 6, 2, 7, 2, 10, 2, 5, 10, 3, 2, 3, 2, 2, 2, 4, 2, 2, 5, 3, 21, 3, 2, 5, 5, 5, 3, 3, 13, 2, 2, 3, 2, 2, 4, 5, 2, 2, 3, 4, 2, 4, 2, 3
Offset: 1

Views

Author

Keywords

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 864.
  • 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).

Crossrefs

Programs

  • Mathematica
    Table[(k=-1;While[MultiplicativeOrder[k,p]!=p-1,k--];-k),{p,Prime@Range@100}] (* Giorgos Kalogeropoulos, Sep 28 2023 *)

Formula

a(n) = prime(n) - A071894(n). - T. D. Noe, Oct 24 2005

A047934 Consider primes p with least positive primitive root g such that q=p+g is next prime after p; sequence gives values of p.

Original entry on oeis.org

2, 3, 5, 11, 29, 59, 101, 107, 149, 151, 179, 197, 227, 251, 269, 271, 337, 347, 367, 419, 461, 659, 733, 821, 827, 971, 991, 1019, 1021, 1061, 1091, 1229, 1277, 1301, 1427, 1451, 1619, 1667, 1787, 1877, 1931, 1949, 1997, 2027, 2141, 2237, 2267, 2309
Offset: 1

Views

Author

Keywords

Examples

			11 has primitive root 2 and 11+2 = 13 is prime after 11, so 11 is in sequence.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 864.

Crossrefs

Cf. A047933, A047935. See also A001918.

Programs

  • Mathematica
    ok[p_] := (p + PrimitiveRoot[p] == NextPrime[p]); Select[Prime[Range[343]], ok]  (* Jean-François Alcover, May 03 2011 *)
    Transpose[Select[Partition[Prime[Range[400]],2,1],#[[2]]-#[[1]] == PrimitiveRoot[ #[[1]]]&]][[1]] (* Harvey P. Dale, Oct 08 2012 *)

Extensions

More terms from James Sellers, Dec 22 1999

A084739 Let p = n-th prime, then a(n) = smallest prime having p as its least prime primitive root.

Original entry on oeis.org

3, 7, 23, 41, 109, 457, 311, 191, 2137, 409, 1021, 1031, 1811, 271, 14293, 2791, 55441, 35911, 57991, 221101, 23911, 11971, 110881, 103091, 71761, 513991, 290041, 31771, 448141, 2447761, 674701, 3248701, 2831011, 690541, 190321, 2080597, 4076641
Offset: 1

Views

Author

N. J. A. Sloane, Jul 03 2003

Keywords

Comments

Smallest prime(m) such that A002233(m) = prime(n). (Corrected by Jonathan Sondow, Feb 02 2013)

Crossrefs

Cf. A084735, A001918, A079061. For records see A133434.

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com) and Don Reble, Jul 03 2003

A103336 Numbers whose largest primitive root (A046146) is not prime.

Original entry on oeis.org

1, 2, 11, 17, 19, 23, 29, 31, 37, 38, 41, 43, 47, 53, 58, 59, 62, 67, 71, 73, 74, 79, 81, 82, 83, 86, 89, 94, 97, 101, 107, 113, 118, 121, 122, 125, 127, 131, 134, 137, 139, 146, 149, 151, 157, 158, 162, 163, 167, 173, 178, 179, 191, 193, 194, 197, 211, 218, 223
Offset: 1

Views

Author

Harry J. Smith, Jan 31 2005

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[250], #==1 || ((p = PrimitiveRootList[#]) != {} && ! PrimeQ[Max @ p]) &] (* Amiram Eldar, Sep 25 2021 *)

Extensions

Offset corrected by Amiram Eldar, Sep 25 2021

A103337 Smallest primitive root of numbers in sequence A103335.

Original entry on oeis.org

0, 1, 6, 6, 6, 6, 6, 6, 10, 10, 21, 6, 21, 15, 15, 15, 15, 6, 6, 21, 15, 6, 6, 10, 14, 6, 6, 10, 6, 6, 6, 14, 6, 6, 10, 6, 6, 14, 10, 6, 21, 10, 35, 6, 6, 6, 15, 6, 6, 10, 21, 14, 6, 33, 6, 6, 10, 6, 6, 6, 10, 6, 22, 15, 15, 6, 10, 12, 6, 15, 15, 10, 14, 21, 6, 15, 6, 6, 6, 6, 6, 6, 6, 10, 10, 6
Offset: 1

Views

Author

Harry J. Smith, Jan 31 2005

Keywords

Crossrefs

Programs

Extensions

Offset changed by Robert Israel, Sep 08 2020

A103338 Largest primitive root of numbers in sequence A103336.

Original entry on oeis.org

0, 1, 8, 14, 15, 21, 27, 24, 35, 33, 35, 34, 45, 51, 55, 56, 55, 63, 69, 68, 69, 77, 77, 75, 80, 77, 86, 91, 92, 99, 104, 110, 115, 117, 115, 123, 118, 128, 117, 134, 135, 141, 147, 146, 152, 153, 155, 159, 165, 171, 175, 176, 189, 188, 189, 195, 207, 207, 214
Offset: 1

Views

Author

Harry J. Smith, Jan 31 2005

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local m; uses NumberTheory;
      if n::odd then
        if NumberOfPrimeFactors(n,distinct) > 1 then return NULL fi;
      elif n mod 4 = 0 or NumberOfPrimeFactors(n,distinct) > 2 then return NULL
      fi;
      m:= PrimitiveRoot(n, ith=Totient(Totient(n)));
      if isprime(m) then NULL else m fi
    end proc:
    f(1):= 0:map(f, [$1..300]); # Robert Israel, Dec 01 2024

Extensions

Offset changed by Robert Israel, Dec 01 2024
Previous Showing 31-40 of 96 results. Next