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.

A222185 Least prime q with q^(p-1) == 1 (mod p^2), where p = A222184(n).

Original entry on oeis.org

3, 19, 53, 11, 31, 53, 43, 19, 79, 71, 223, 257, 251, 349, 307, 241, 197, 503, 467, 643, 13, 127, 457, 419, 487, 617, 691, 2, 241, 997, 821, 683, 653, 421, 941, 1069, 1481, 709, 463, 461, 1153, 1381, 631, 449, 1091, 277, 1993, 367, 659, 151, 1657, 823, 1493, 431, 1787, 2063, 1487, 59, 2389, 2131, 479, 1907, 79, 173, 1151, 1831, 419, 1193, 2, 3319
Offset: 1

Views

Author

Jonathan Sondow, Feb 12 2013

Keywords

Examples

			3 is the smallest prime < A222184(1) = 11 such that 11^2 divides 3^(11-1)-1 = 59048 = 121*488, so a(1) = 3.
		

References

  • L. E. Dickson, History of the Theory of Numbers, vol. 1, chap. IV.

Crossrefs

Programs

  • Mathematica
    L = Select[ Prime[ Range[500]], Product[ PowerMod[ Prime[k], # - 1, #^2] - 1, {k, 1, PrimePi[#] - 1}] == 0 &]; Table[  Min[ Select[ Prime[ Range[ PrimePi[L[[n]]] - 1]], PowerMod[#, L[[n]] - 1, L[[n]]^2] == 1 &]], {n, 1, Length[L]}]

A134307 Primes p such that A^(p-1) == 1 (mod p^2) for some A in the range 2 <= A <= p-1.

Original entry on oeis.org

11, 29, 37, 43, 59, 71, 79, 97, 103, 109, 113, 127, 131, 137, 151, 163, 181, 191, 197, 199, 211, 223, 229, 233, 241, 257, 263, 269, 281, 283, 293, 307, 313, 331, 347, 349, 353, 359, 367, 373, 379, 397, 401, 419, 421, 433, 439, 449, 461, 463, 487, 499, 509
Offset: 1

Views

Author

Joerg Arndt, Aug 27 2008

Keywords

Comments

It's worth observing that there are p-1 elements of order dividing p-1 modulo p^2 that are of the form r^(k*p) mod p^2 where r is a primitive element modulo p and k=0,1,...,p-2. Heuristically, one can expect that at least one of them belongs to the interval [2,p-1] with probability about 1 - (1 - 1/p)^(p-1) ~= 1 - 1/e.
Numerically, among the primes below 1000 (out of the total number pi(1000)=168) there are 103 terms of the sequence, and the ratio 103/168 = 0.613 which is already somewhat close to 1-1/e ~= 0.632.
If we replace p^2 with p^3, heuristically it is likely that the sequence is finite (since 1 - (1 - 1/p^2)^(p-1) tends to 0 as p grows). - Max Alekseyev, Jan 09 2009
Replacing p^2 with p^3 gives just the one term (113) for p < 10^6. - Joerg Arndt, Jan 07 2011
If furthermore the number A can be taken to be a primitive root modulo p, i.e., A is a generator of (Z/pZ)*, then that p belongs to A060503. - Jeppe Stig Nielsen, Jul 31 2015
The number of terms not exceeding prime(10^k), for k=1,2,..., are 2, 55, 652, 6303, 63219, ... - Amiram Eldar, May 08 2021

Examples

			Examples (pairs [p, A]):
[11, 3]
[11, 9]
[29, 14]
[37, 18]
[43, 19]
[59, 53]
[71, 11]
[71, 26]
[79, 31]
[97, 53]
		

References

  • L. E. Dickson, History of the theory of numbers, vol. 1, p. 105.

Crossrefs

Programs

  • Mathematica
    Select[ Prime[ Range[100]], Product[ (PowerMod[a, # - 1, #^2] - 1), {a, 2, # - 1}] == 0 &] (* Jonathan Sondow, Feb 11 2013 *)
  • PARI
    { forprime (p=2, 1000,
       for (a=2, p-1, p2 = p^2;
         if( Mod(a, p2)^(p-1) == Mod(1, p2), print1(p, ", ") ;break() );
      ); ); }

A222206 Least prime p such that q^(p-1) == 1 (mod p^2) for n primes q < p.

Original entry on oeis.org

2, 11, 349, 13691, 24329
Offset: 0

Views

Author

Jonathan Sondow, Feb 12 2013

Keywords

Comments

I found no new terms < 5*10^6. - J. Stauduhar, Mar 23 2013
a(5) > 13*10^6, if it exists. Note that, up to 13*10^6, the only other prime p (apart 24329) such that the congruence is satisfied for 4 primes q < p is 9656869. - Giovanni Resta, May 23 2017

Examples

			For the prime p = 349, but for no smaller prime, there are 2 primes q = 223 and 317 < p with  q^(p-1) == 1 (mod p^2), so a(2) = 349.
		

References

  • L. E. Dickson, History of the Theory of Numbers, vol. 1, chap. IV.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 2, q = {}}, While[ Count[ PowerMod[ q, p - 1, p^2], 1] != n, q = Join[q, {p}]; p = NextPrime@ p]; p]; Array[f, 5, 0] (* Robert G. Wilson v, Mar 09 2015 *)
  • PARI
    a(n) = {nb = 0; p = 2; while (nb != n, p = nextprime(p+1); nb = 0; forprime(q=2, p-1, if (Mod(q, p^2)^(p-1) == 1, nb ++); if (nb > n, break););); p;} \\ Michel Marcus, Mar 08 2015

A285931 Number of primes q < p such that q^(p-1) == 1 (modulo p^2), where p = prime(n).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Felix Fröhlich, Apr 30 2017

Keywords

Comments

Pairs of prime numbers (q, p) satisfying the conditions in the definition are sometimes called "Wieferich prime pairs" (cf. Mossinghoff, 2009).
a(n) > 0 iff p is a term of A222184.
First occurrence of k beginning at 0: 1, 5, 70, 1618, 2702, etc. - Robert G. Wilson v, May 10 2017

Examples

			For n = 70: prime(70) = 349 and there are two primes q < 349 such that q^(349-1) == 1 (modulo 349^2), namely 223 and 317, so a(70) = 2.
		

Crossrefs

Cf. A222184, A222206 (records).

Programs

  • Mathematica
    f[n_] := Block[{c = 0, p = Prime@ n, q = 2}, While[q < p, If[ PowerMod[q, p - 1, p^2] == 1, c++]; q = NextPrime@q]; c]; Array[f, 105] (* Robert G. Wilson v, May 10 2017 *)
  • PARI
    a(n) = my(p=prime(n), i=0); forprime(q=1, p-1, if(Mod(q, p^2)^(p-1)==1, i++)); i
Showing 1-4 of 4 results.