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 27 results. Next

A062117 Order of 3 mod n-th prime.

Original entry on oeis.org

1, 0, 4, 6, 5, 3, 16, 18, 11, 28, 30, 18, 8, 42, 23, 52, 29, 10, 22, 35, 12, 78, 41, 88, 48, 100, 34, 53, 27, 112, 126, 65, 136, 138, 148, 50, 78, 162, 83, 172, 89, 45, 95, 16, 196, 198, 210, 222, 113, 57, 232, 119, 120, 125, 256, 131, 268, 30, 69, 280, 282, 292, 34
Offset: 1

Views

Author

Olivier Gérard, Jun 06 2001

Keywords

Examples

			The 3rd prime is 5 and mod 5, 3^4 = 1, so a(3) = 4.
		

Crossrefs

Cf. A019334 (full reptend primes in base 3).

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);;
    List([1..Length(A000040)],n->OrderMod(3,A000040[n])); # Muniru A Asiru, Feb 07 2019
    
  • Mathematica
    Table[With[{p=Prime[n]},If[p==3,0,MultiplicativeOrder[3,p]]],{n,63}] (* Ray Chandler, Apr 06 2016 *)
  • PARI
    a(n,{base=3}) = my(p=prime(n)); if(base%p, znorder(Mod(base,p)), 0) \\ Jianing Song, May 13 2024
  • Python
    from sympy import n_order, prime
    def A062117(n): return n_order(3,prime(n)) if n != 2 else 0 # Chai Wah Wu, Nov 10 2023
    

A167792 Numbers with primitive root 3.

Original entry on oeis.org

2, 4, 5, 7, 10, 14, 17, 19, 25, 29, 31, 34, 38, 43, 49, 50, 53, 58, 62, 79, 86, 89, 98, 101, 106, 113, 125, 127, 137, 139, 149, 158, 163, 173, 178, 197, 199, 202, 211, 223, 226, 233, 250, 254, 257, 269, 274, 278, 281, 283, 289, 293, 298, 317, 326, 331, 343, 346
Offset: 1

Views

Author

T. D. Noe, Nov 12 2009

Keywords

Crossrefs

Cf. A019334 (primes with primitive root 3)

Programs

  • Mathematica
    pr=3; Select[Range[2,2000], MultiplicativeOrder[pr,# ] == EulerPhi[ # ] &]
  • PARI
    is(n)=if(n%3==0, return(0)); my(p=eulerphi(n)); znorder(Mod(3, n), p)==p \\ Charles R Greathouse IV, Jan 04 2025

A019335 Primes with primitive root 5.

Original entry on oeis.org

2, 3, 7, 17, 23, 37, 43, 47, 53, 73, 83, 97, 103, 107, 113, 137, 157, 167, 173, 193, 197, 223, 227, 233, 257, 263, 277, 283, 293, 307, 317, 347, 353, 373, 383, 397, 433, 443, 463, 467, 503, 523, 547, 557, 563, 577, 587, 593, 607, 613, 617, 647, 653, 673, 677, 683, 727
Offset: 1

Views

Author

Keywords

Comments

To allow primes less than the specified primitive root m (here, 5) to be included, we use the essentially equivalent definition "Primes p such that the multiplicative order of m mod p is p-1". This comment applies to all of A019334-A019421. - N. J. A. Sloane, Dec 02 2019
Appears to be the numbers k such that the sequence 5^n mod k has period length k-1. All terms are congruent to 2 or 3 mod 5. - Gary Detlefs, May 21 2014
From Jianing Song, Apr 27 2019: (Start)
If we define
Pi(N,b) = # {p prime, p <= N, p == b (mod 5)};
Q(N) = # {p prime, p <= N, p in this sequence},
then by Artin's conjecture, Q(N) ~ (20/19)*C*N/log(N) ~ (40/19)*C*(Pi(N,2) + Pi(N,3)), where C = A005596 is Artin's constant.
Conjecture: if we further define
Q(N,b) = # {p prime, p <= N, p == b (mod 5), p in this sequence},
then we have:
Q(N,2) ~ (1/2)*Q(N) ~ (20/19)*C*Pi(N,2);
Q(N,3) ~ (1/2)*Q(N) ~ (20/19)*C*Pi(N,3). (End)

Crossrefs

Programs

  • Mathematica
    pr=5; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &]
  • PARI
    isok(p) = isprime(p) && (p != 5) && (znorder(Mod(5, p)) == p-1); \\ Michel Marcus, Apr 27 2019

A001123 Primes with 3 as smallest primitive root.

Original entry on oeis.org

7, 17, 31, 43, 79, 89, 113, 127, 137, 199, 223, 233, 257, 281, 283, 331, 353, 401, 449, 463, 487, 521, 569, 571, 593, 607, 617, 631, 641, 691, 739, 751, 809, 811, 823, 857, 881, 929, 953, 977, 1013, 1039, 1049, 1063, 1087, 1097, 1193, 1217
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.
  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 57.
  • 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

Cf. A001122, A001124, etc.
Cf. A019334.

Programs

  • Mathematica
    Prime[ Select[ Range[200], PrimitiveRoot[ Prime[ # ]] == 3 & ]]
    (* or *)
    Select[ Prime@Range@200, PrimitiveRoot@# == 3 &] (* Robert G. Wilson v, May 11 2001 *)
  • PARI
    forprime(p=3, 1000, if(znorder(Mod(2, p))!=p-1&&znorder(Mod(3, p))==p-1, print1(p,", ")));
    
  • PARI
    { n=0; forprime (p=3, 99999, if (znorder(Mod(2,p))!=p-1 && znorder(Mod(3,p))==p-1, n++; write("b001123.txt", n, " ", p); if (n>=1000, break) ) ) } \\ Harry J. Smith, Jun 14 2009
    
  • Python
    from itertools import islice
    from sympy import nextprime, is_primitive_root
    def A001123_gen(): # generator of terms
        p = 3
        while (p:=nextprime(p)):
            if not is_primitive_root(2,p) and is_primitive_root(3,p):
                yield p
    A001123_list = list(islice(A001123_gen(),30)) # Chai Wah Wu, Feb 13 2023

Extensions

More terms from Robert G. Wilson v, May 10 2001

A019421 Primes with primitive root 99.

Original entry on oeis.org

2, 17, 23, 41, 47, 59, 67, 71, 73, 101, 103, 109, 149, 173, 179, 191, 197, 199, 223, 233, 241, 251, 277, 293, 311, 331, 337, 349, 367, 373, 379, 383, 409, 419, 443, 457, 461, 467, 499, 541, 557, 569, 587, 593, 599, 613, 619, 631, 643, 673, 677, 683, 691, 719, 733, 761
Offset: 1

Views

Author

Keywords

Comments

To allow primes less than the specified primitive root m (here, 99) to be included, we use the essentially equivalent definition "Primes p such that the multiplicative order of m mod p is p-1". This comment applies to all of A019334-A019421. - N. J. A. Sloane, Dec 03 2019

Programs

  • Mathematica
    pr=99; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &]

A019337 Primes with primitive root 7.

Original entry on oeis.org

2, 5, 11, 13, 17, 23, 41, 61, 67, 71, 79, 89, 97, 101, 107, 127, 151, 163, 173, 179, 211, 229, 239, 241, 257, 263, 269, 293, 347, 349, 359, 379, 397, 431, 433, 443, 461, 491, 499, 509, 521, 547, 577, 593, 599, 601, 631, 659, 677, 683, 733, 739, 743, 761, 773, 797, 823
Offset: 1

Views

Author

Keywords

Comments

To allow primes less than the specified primitive root m (here, 7) to be included, we use the essentially equivalent definition "Primes p such that the multiplicative order of m mod p is p-1". This comment applies to all of A019334-A019421. - N. J. A. Sloane, Dec 03 2019
All terms apart from the first are == 5, 11, 13, 15, 17, 23 (mod 28) since 7 is a quadratic residue modulo any other prime. By Artin's conjecture, this sequence contains about 37.395% of all primes, that is, about 74.79% of all primes == 5, 11, 13, 15, 17, 23 (mod 28). - Jianing Song, Sep 05 2018

Crossrefs

Cf. A167795.

Programs

  • Mathematica
    pr=7; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &]

A019339 Primes with primitive root 11.

Original entry on oeis.org

2, 3, 13, 17, 23, 29, 31, 41, 47, 59, 67, 71, 73, 101, 103, 109, 149, 163, 173, 179, 197, 223, 233, 251, 277, 281, 293, 331, 367, 373, 383, 419, 443, 461, 463, 467, 487, 499, 557, 569, 587, 593, 599, 601, 613, 619, 643, 647, 673, 677, 683, 701, 719, 761, 769, 809, 821
Offset: 1

Views

Author

Keywords

Comments

To allow primes less than the specified primitive root m (here, 11) to be included, we use the essentially equivalent definition "Primes p such that the multiplicative order of m mod p is p-1". This comment applies to all of A019334-A019421. - N. J. A. Sloane, Dec 03 2019
This is a subsequence of A038882. - Klaus Purath, Jul 03 2023

Crossrefs

Cf. A071566.

Programs

  • Mathematica
    pr=11; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &]

A105874 Primes for which -2 is a primitive root.

Original entry on oeis.org

5, 7, 13, 23, 29, 37, 47, 53, 61, 71, 79, 101, 103, 149, 167, 173, 181, 191, 197, 199, 239, 263, 269, 271, 293, 311, 317, 349, 359, 367, 373, 383, 389, 421, 461, 463, 479, 487, 503, 509, 541, 557, 599, 607, 613, 647, 653, 661, 677, 701, 709, 719, 743, 751, 757, 773, 797
Offset: 1

Views

Author

N. J. A. Sloane, Apr 24 2005

Keywords

Comments

Also primes for which (p-1)/2 (==-1/2 mod p) is a primitive root. [Joerg Arndt, Jun 27 2011]

Crossrefs

Programs

  • Maple
    with(numtheory); f:=proc(n) local t1,i,p; t1:=[]; for i from 1 to 500 do p:=ithprime(i); if order(n,p) = p-1 then t1:=[op(t1),p]; fi; od; t1; end; f(-2);
  • Mathematica
    pr=-2; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &] (* N. J. A. Sloane, Jun 01 2010 *)
    a[p_,q_]:=Sum[2 Cos[2^n Pi/((2 q+1) (2 p+1))], {n,1,2 q p}];
    Select[Range[400], Reduce[a[#, 1] == 1, Integers] &];
    2 % + 1 (* Gerry Martens, Apr 28 2015 *)
  • PARI
    forprime(p=3,10^4,if(p-1==znorder(Mod(-2,p)),print1(p", "))); /* Joerg Arndt, Jun 27 2011 */
    
  • Python
    from sympy import n_order, nextprime
    from itertools import islice
    def A105874_gen(startvalue=3): # generator of terms >= startvalue
        p = max(startvalue-1,2)
        while (p:=nextprime(p)):
            if n_order(-2,p) == p-1:
                yield p
    A105874_list = list(islice(A105874_gen(),20)) # Chai Wah Wu, Aug 11 2023

Formula

Let a(p,q)=sum(n=1,2*p*q,2*cos(2^n*Pi/((2*q+1)*(2*p+1)))). Then 2*p+1 is a prime belonging to this sequence when a(p,1)==1. - Gerry Martens, May 21 2015

A019338 Primes with primitive root 8.

Original entry on oeis.org

3, 5, 11, 29, 53, 59, 83, 101, 107, 131, 149, 173, 179, 197, 227, 269, 293, 317, 347, 389, 419, 443, 461, 467, 491, 509, 557, 563, 587, 653, 659, 677, 701, 773, 797, 821, 827, 941, 947, 1019, 1061, 1091, 1109, 1187, 1229, 1259, 1277, 1283, 1301, 1307, 1373, 1427
Offset: 1

Views

Author

Keywords

Comments

To allow primes less than the specified primitive root m (here, 8) to be included, we use the essentially equivalent definition "Primes p such that the multiplicative order of m mod p is p-1". This comment applies to all of A019334-A019421. - N. J. A. Sloane, Dec 03 2019
Members of A001122 that are not congruent to 1 mod 3. - Robert Israel, Aug 12 2014
Terms greater than 3 are congruent to 5 or 11 modulo 24. - Jianing Song, May 12 2024 [Corrected on May 13 2025]

Programs

  • Maple
    select(t -> isprime(t) and numtheory:-order(8,t) = t-1, [2*i+1 $ i=1..1000]); # Robert Israel, Aug 12 2014
  • Mathematica
    pr=8; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &] (* N. J. A. Sloane, Jun 01 2010 *)
    a[p_, q_]:=Sum[2 Cos[2^n Pi/((2 q+1)(2 p+1))],{n,1,2 q p}]
    2 Select[Range[800],Rationalize[N[a[#, 3],20]]==1 &]+1
    (* Gerry Martens, Apr 28 2015 *)
    Join[{3,5},Select[Prime[Range[250]],PrimitiveRoot[#,8]==8&]] (* Harvey P. Dale, Aug 10 2019 *)
  • PARI
    is(n)=isprime(n) && n>2 && znorder(Mod(8,n))==n-1 \\ Charles R Greathouse IV, May 21 2015

Formula

Let a(p,q)=sum(n=1,2*p*q,2*cos(2^n*Pi/((2*q+1)*(2*p+1)))). Then 2*p+1 is a prime of this sequence when a(p,3)==1. - Gerry Martens, May 15 2015
On Artin's conjecture, a(n) ~ (5/3A) n log n, where A = A005596 is Artin's constant. - Charles R Greathouse IV, May 21 2015

A167408 Orderly numbers: a number n is orderly if there exists some number k > tau(n) such that the set of the divisors of n is congruent to the set {1,2,...,tau(n)} mod k.

Original entry on oeis.org

1, 2, 5, 7, 8, 9, 11, 12, 13, 17, 19, 20, 23, 27, 29, 31, 37, 38, 41, 43, 47, 52, 53, 57, 58, 59, 61, 67, 68, 71, 72, 73, 76, 79, 83, 87, 89, 97, 101, 103, 107, 109, 113, 117, 118, 124, 127, 131, 133, 137, 139, 149, 151, 157, 158, 162, 163, 164, 167, 173, 177, 178, 179
Offset: 1

Views

Author

Andrew Weimholt, Nov 03 2009

Keywords

Comments

n: {divisors(n)} == {1,2,...,tau(n)} mod k
-------------------------------------------
1: {1} == {1} mod 2
2: {1,2} == {1,2} mod 3
5: {1,5} == {1,2} mod 3
7: {1,7} == {1,2} mod 5
8: {1,2,8,4} == {1,2,3,4} mod 5
9: {1,9,3} == {1,2,3} mod 7
11: {1,11} == {1,2} mod 3 or 9
12: {1,2,3,4,12,6} == {1,2,3,4,5,6} mod 7
13: {1,13} == {1,2} mod 11
17: {1,17} == {1,2} mod 3,5, or 15
19: {1,19} == 1,2 mod 17
20: {1,2,10,4,5,20} == {1,2,3,4,5,6} mod 7
23: {1,23} == {1,2} mod 3,7, or 21
27: {1,27,3,9} == {1,2,3,4} mod 5
29: {1,29} == {1,2} mod 3,9, or 27
31: {1,31} == {1,2} mod 29
37: {1,37} == 1,2 mod 5,7, or 35
38: {1,2,38,19} == {1,2,3,4} mod 5
41: {1,41} == {1,2} mod 3,13, or 39
43: {1,43} == {1,2} mod 41
47: {1,47} == {1,2} mod 3,5,9,15, or 45
52: {1,2,52,4,26,13} == {1,2,3,4,5,6} mod 7
53: {1,53} == {1,2} mod 3,17, or 51
57: {1,57,3,19} == {1,2,3,4} mod 5
58: {1,2,58,29} == {1,2,3,4} mod 5
59: {1,59} == {1,2} mod 3,19, or 57
61: {1,61} == {1,2} mod 59
67: {1,67} == {1,2} mod 5,13, or 65
68: {1,2,17,4,68,34} == {1,2,3,4,5,6} mod 7
71: {1,71} == {1,2} mod 3,23, or 69
72: {1,2,3,4,18,6,72,8,9,36,24,12} == {1,2,3,4,5,6,7,8,9,10,11,12} mod 13
73: {1,73} == {1,2} mod 71
76: {1,2,38,4,19,76} == {1,2,3,4,5,6} mod 7
79: {1,79} == {1,2} mod 7,11, or 77
83: {1,83} == {1,2} mod 3,9,27, or 81
87: {1,87,3,29} == {1,2,3,4} mod 5
89: {1,89} == {1,2} mod 3,29, or 87
97: {1,97} == {1,2} mod 5,19, or 95
The primes other than 3 are orderly.
Numbers of the form 4p are orderly when p is an odd prime congruent to 3,5, or 6 mod 7.
For primes, k values can be p-2 or a divisor of p-2 other than 1.
T. D. Noe observed that for composite orderly numbers, n, k seems to be one of the three values: tau(n)+1, tau(n)+3, tau(n)+4.
The composite numbers with k = tau(n)+4 are of the form p^2, where prime p == 3 mod 7.
The orderly numbers with k = tau(n)+3 come in many forms. See A168003. It appears that tau(n)+3 is a prime with primitive root 2 (A001122).
The forms for composite orderly numbers with k = tau(n)+1 are too numerous to list here, but seem to occur for any prime k > 3.
Let p be any prime. Then p^(m-2) is in this sequence if m is a prime with primitive root p. For example, 2^(m-2) is here for every m in A001122; 3^(m-2) is here for every m in A019334; 5^(m-2) is here for every m in A019335. For every prime p, there appear to be an infinite number of prime powers p^(m-2) here. All these numbers are actually very orderly (A167409) because we can choose k = tau(n)+1. - T. D. Noe, Nov 04 2009

Examples

			12 is an orderly number because 12's divisors are 1,2,3,4,6,12 and
   1 == 1 (mod 7)
   2 == 2 (mod 7)
   3 == 3 (mod 7)
   4 == 4 (mod 7)
  12 == 5 (mod 7)
   6 == 6 (mod 7)
		

Crossrefs

Cf. A167409 = very orderly numbers (k = tau(n) + 1).
Cf. A167410 = disorderly numbers = numbers not in this sequence.
Cf. A167411 = minimal k values for the orderly numbers.

Programs

  • Mathematica
    orderlyQ[n_] := (For[dd = Divisors[n]; tau = Length[dd]; k = 3, k <= Max[tau + 4, Last[dd] - 2], k++, If[ Union[ Mod[dd, k]] == Range[tau], Return[True]]]; False); Select[ Range[180], orderlyQ] (* Jean-François Alcover, Aug 19 2013 *)

Extensions

Minor editing by N. J. A. Sloane, Nov 06 2009
Information about the tau(n)+3 orderly numbers corrected by T. D. Noe, Nov 16 2009
Showing 1-10 of 27 results. Next