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

A001122 Primes with primitive root 2.

Original entry on oeis.org

3, 5, 11, 13, 19, 29, 37, 53, 59, 61, 67, 83, 101, 107, 131, 139, 149, 163, 173, 179, 181, 197, 211, 227, 269, 293, 317, 347, 349, 373, 379, 389, 419, 421, 443, 461, 467, 491, 509, 523, 541, 547, 557, 563, 587, 613, 619, 653, 659, 661, 677, 701, 709, 757, 773, 787, 797
Offset: 1

Views

Author

Keywords

Comments

Artin conjectured that this sequence is infinite.
Conjecture: sequence contains infinitely many pairs of twin primes. - Benoit Cloitre, May 08 2003
Pieter Moree writes (Oct 20 2004): Assuming the Generalized Riemann Hypothesis, it can be shown that the density of primes p such that a prescribed integer g has order (p-1)/t, with t fixed, exists and, moreover, it can be computed. This density will be a rational number times the so-called Artin constant. For 2 and 10 the density of primitive roots is A, the Artin constant itself.
It seems that this sequence consists of A050229 \ {1,2}.
Primes p such that 1/p, when written in base 2, has period p-1, which is the greatest period possible for any integer.
Positive integer 2*m-1 is in the sequence iff A179382(m)=m-1. - Vladimir Shevelev, Jul 14 2010
These are the odd primes p for which the polynomial 1+x+x^2+...+x^(p-1) is irreducible over GF(2). - V. Raman, Sep 17 2012 [Corrected by N. J. A. Sloane, Oct 17 2012]
Prime(n) is in the sequence if (and conjecturally only if) A133954(n) = prime(n). - Vladimir Shevelev, Aug 30 2013
Pollack shows that, on the GRH, that there is some C such that a(n+1) - a(n) < C infinitely often (in fact, 1 can be replaced by any positive integer). Further, for any m, a(n), a(n+1), ..., a(n+m) are consecutive primes infinitely often. - Charles R Greathouse IV, Jan 05 2015
From Jianing Song, Apr 27 2019: (Start)
All terms are congruent to 3 or 5 modulo 8. If we define
Pi(N,b) = # {p prime, p <= N, p == b (mod 8)};
Q(N) = # {p prime, p <= N, p in this sequence},
then by Artin's conjecture, Q(N) ~ C*N/log(N) ~ 2*C*(Pi(N,3) + Pi(N,5)), where C = A005596 is Artin's constant.
Conjecture: if we further define
Q(N,b) = # {p prime, p <= N, p == b (mod 8), p in this sequence},
then we have:
Q(N,3) ~ (1/2)*Q(N) ~ C*Pi(N,3);
Q(N,5) ~ (1/2)*Q(N) ~ C*Pi(N,5). (End)
Conjecture: for a prime p > 5, p has primitive root 2 iff p == +-3 (mod 8) divides 2^k + 3 for some k < p - 1 and divides 2^m + 5 for some m < p - 1. It seems that all primes of the form 2^k + 3 for k <> 2 (A057732) have primitive root 2. - Thomas Ordowski, Nov 27 2023

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.
  • E. Bach and Jeffrey Shallit, Algorithmic Number Theory, I; see p. 221.
  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, New York, 1996; see p. 169.
  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 56.
  • Lehmer, D. H. and Lehmer, Emma; Heuristics, anyone? in Studies in mathematical analysis and related topics, pp. 202-210, Stanford Univ. Press, Stanford, Calif., 1962.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 20.
  • D. Shanks, Solved and Unsolved Problems in Number Theory, 2nd. ed., Chelsea, 1978, p. 81.
  • 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. A002326 for the multiplicative order of 2 mod 2n+1. (Alternatively, the least positive value of m such that 2n+1 divides 2^m-1).
Cf. A216838 (Odd primes for which 2 is not a primitive root).

Programs

  • Mathematica
    Select[ Prime@Range@200, PrimitiveRoot@# == 2 &] (* Robert G. Wilson v, May 11 2001 *)
    pr = 2; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == # - 1 &] (* N. J. A. Sloane, Jun 01 2010 *)
  • PARI
    forprime(p=3, 1000, if(znorder(Mod(2, p))==(p-1), print1(p,", "))); \\ [corrected by Michel Marcus, Oct 08 2014]
    
  • Python
    from itertools import islice
    from sympy import nextprime, is_primitive_root
    def A001122_gen(): # generator of terms
        p = 2
        while (p:=nextprime(p)):
            if is_primitive_root(2,p):
                yield p
    A001122_list = list(islice(A001122_gen(),30)) # Chai Wah Wu, Feb 13 2023

Formula

Delta(a(n),2^a(n)*x) = a(n)*Delta(a(n),2*x), where Delta(k,x) is the difference between numbers of evil(A001969) and odious(A000069) integers divisible by k in interval [0,x). - Vladimir Shevelev, Aug 30 2013
For n >= 2, a(n) = 1 + 2*A163782(n-1). - Antti Karttunen, Oct 07 2017

A242595 a(n) is the primitive period length for the sequence 2^k (mod n), k = 1, 2, ...

Original entry on oeis.org

1, 1, 2, 0, 4, 2, 3, 0, 6, 4, 10, 0, 12, 3, 4, 0, 8, 6, 18, 0, 6, 10, 11, 0, 20, 12, 18, 0, 28, 4, 5, 0, 10, 8, 12, 0, 36, 18, 12, 0, 20, 6, 14, 0, 12, 11, 23, 0, 21, 20, 8, 0, 52, 18, 20, 0, 18, 28, 58, 0, 60, 5, 6, 0, 12, 10, 66, 0, 22, 12, 35, 0, 9, 36, 20, 0, 30, 12, 39, 0, 54, 20, 82, 0, 8, 14, 28, 0
Offset: 1

Views

Author

Wolfdieter Lang, May 18 2014

Keywords

Comments

The computation of this sequence was inspired by Gary Detlefs's May 15 2014 comment on A050229.
It is clear that 2^k (mod 4*m), for k >= 1 is not periodic because otherwise 4*m would divide 2^k*(2^P - 1) for all k >= 1, with P >= 1 the period length. But this is false for k = 1. Therefore, a(4*m) = 0.
a(2*(2*m+1)) = a(2*m+1), m = (0), 1, 2, ... because 2*(2*m+1) has to divide 2^k*(2^a(2*(2*m+1) - 1) for each k >= 1, which means that (2*m+1) has to divide (2^a(2*(2*m+1)) - 1), and a(2*(2*m+1)) has to be the smallest such number. But the smallest number P such that (2*m+1) divides (2^P - 1) is P = a(2*m+1).
a(prime) = phi(prime) = prime - 1 (phi is given in A000010) is equivalent to: prime divides 2^k*(2^(prime-1) - 1), for all k >= 1, and prime-1 is the smallest exponent. For the even prime 2 this is trivial, and for an odd prime p this means that p divides 2^phi(prime) - 1, but not with a smaller exponent; that is 2 is a primitive root modulo this odd p. See A001122 for the primes with primitive root 2. This means that a(prime) = prime - 1 exactly for 2 and the odd primes of A001122. The odd primes with no primitive root 2 are given in A216838.
For composite odd numbers m one has: m divides (2^a(m) - 1) with the smallest such a(m).

Examples

			a(1) = 1 because 2^1 == 0 == 1 (mod 1), therefore 2^k (mod 1) is the 0-sequence with primitive period length 1.
a(2) = 1 because 2^k == 0 (mod 2) for k >= 1, hence also the 0-sequence with primitive period length 1. Note that 2 is not a primitive root of 2 even though a(2) = 2-1 = 1 (see the comment above).
a(3) = 3-1 = 2 because 3 is odd and 2 is a primitive root modulo 3. See A001122(1).
a(7) = 3 because the sequence 2^k (mod 7) starts 2, 4, 1, ... therefore the primitive period is 2, 4, 1 of length 3, because 2^(k+3) = 2^k*8 == 2^k*1 (mod 7) == 2^k (mod 7) for all k >= 1. The prime 7 belongs to A216838.
a(4) = 0 because a(4*m) = 0 for all m >= 1 (see the comment above).
a(6) = 2 because the sequence starts with 2, 4, 2, ... and
  6 = 2*3 divides 2^k*(2^2 - 1) = 2^k*3 for all k >= 1. That is a(6) = a(3); see a comment above.
a(9) = 6 from the sequence start 2, 4, 8, 7, 5, 1,... Note that a(3^2) = (3-1)*3. a(5^2) = 20 = (4-1)*5. But a(7^2) = 21 = (7-1)*7/2.
		

Crossrefs

Formula

a(n) is the primitive (smallest) period length of the sequence 2^k (mod n), for k >=1, and n >= 1.
Showing 1-2 of 2 results.