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 10 results.

A258367 a(n) is the smallest A (in absolute value) such that for p = prime(n), 2^{(p-1)/2} == +-1 + A*p (mod p^2), i.e., such that p is a near-Wieferich prime.

Original entry on oeis.org

1, 1, 1, 3, 5, 2, 8, 3, 14, 3, 18, 9, 9, 22, 18, 4, 18, 5, 1, 28, 30, 24, 3, 20, 46, 22, 47, 21, 15, 9, 57, 42, 15, 48, 28, 41, 48, 60, 85, 25, 74, 25, 52, 11, 32, 51, 17, 13, 34, 113, 13, 71, 2, 16, 64, 130, 81, 35, 37, 29, 39, 147, 68, 60, 71, 96, 92, 99, 12
Offset: 2

Views

Author

Felix Fröhlich, May 28 2015

Keywords

Comments

p is in A001220 iff a(n) = 0. This is the case iff A014664(n) = A243905(n), which happens for n = 183 and n = 490.
Is a(n) = 0 for any other n, and, if yes, are there infinitely many such n?

Crossrefs

Programs

  • PARI
    a(n,p=prime(n))=abs(centerlift(Mod(2,p^2)^((p-1)/2))\/p)
    apply(p->a(0,p), primes(100)[2..100]) \\ Charles R Greathouse IV, Jun 15 2015

Formula

a(n) = min(b(n) mod p, -b(n) mod p) where p = prime(n) and b(n) = Sum_{i=1..ceiling((p-1)/4)} (2i-1)^(p-2). - Daniel Chen, Sep 01 2022

A195988 Near-Wieferich primes above 10^9: primes p > 10^9 such that 2^((p-1)/2) == +-1 + A*p (mod p^2) with |A| <= 100, i.e., p=prime(i) such that A258367(i) <= 100.

Original entry on oeis.org

1222336487, 1259662487, 1274153897, 1494408397, 1584392531, 1586651309, 1662410923, 1817972423, 1890830857, 2062661389, 2244893621, 2332252547, 2416644757, 2461090421, 2566816313, 2570948153, 2589186937, 2709711233, 2760945133
Offset: 1

Views

Author

Felix Fröhlich, Sep 26 2011

Keywords

Comments

There are many near-Wieferich primes below 10^9 (including Wieferich primes 1093 and 3511). However, Crandall, Dilcher and Pomerance searched and reported such primes in the interval [10^9, 4*10^12].
The choice of upper bound for |A| is rather arbitrary.

Crossrefs

Extensions

Edited by Max Alekseyev, Dec 21 2011
New b-file from Felix Fröhlich, Aug 26 2015
Definition amended by Felix Fröhlich, Aug 29 2015

A353141 Near-Wieferich primes with abs(A) < 2.

Original entry on oeis.org

3, 5, 7, 71, 379, 1093, 2659, 3511, 110057537, 47004625957, 76843523891
Offset: 1

Views

Author

Felix Fröhlich, Apr 26 2022

Keywords

Comments

Primes p such that A258367(i) < 2, where i is the index of p in A000040.
Subsequence of A246568.
Wieferich primes together with the "closest" near-misses possible that are not actually Wieferich.
Countless such sequences with larger bounds on the value of abs(A) are possible. This is one of the few that I believe should be in the OEIS.
The corresponding sequence of A-values is 1, 1, 1, 1, -1, 0, -1, 0, -1, 1, 1.
I checked the range 3 <= p <= 47004625957 with PARI. 76843523891 is from Crandall, Dilcher, Pomerance, 1997.
There are no near-Wieferich primes with abs(A) < 2 in the range 4*10^12 to 1.25*10^15 (cf. Knauer, Richstein, 2005).
There are no near-Wieferich primes with abs(A) < 2 in the range 1*10^15 to 3*10^15 per information I received from Mark Rodenkirch in 2010.
There are no near-Wieferich primes with abs(A) < 2 in the range 3*10^15 to ~6*10^17 (cf. Goetz, cf. Reggie, cf. Fries).
As of Apr 26 2022, a(12) > ~1.1*10^19 if it exists (cf. WW Statistics).
Heuristically, one would expect about 11 to 12 (3*log(log(10^19))) near-Wieferich primes with |A| <= 1 up to 10^19, a very close match to the actual number of 11 (cf. Crandall, Dilcher, Pomerance, 1997, p. 446).

Examples

			The prime p = 110057537 satisfies 2^((p-1)/2) == +1 -p (mod p^2) and is therefore in the sequence.
		

Crossrefs

Programs

  • PARI
    a258367(n) = abs(centerlift(Mod(2, n^2)^((n-1)/2))\/n) \\ after Charles R Greathouse IV in A258367
    forprime(p=3, , if(a258367(p) < 2, print1(p, ", ")))
    
  • PARI
    \\ see Nielsen link for code to check the A-value and +-1-type of a prime

A354675 a(n) is the number of near-Wieferich primes with |A| <= 10 less than 10^n, where A(k) = A258367(k).

Original entry on oeis.org

3, 15, 21, 29, 34, 35, 36, 36, 41
Offset: 1

Views

Author

Felix Fröhlich, Jun 02 2022

Keywords

Comments

A(k) is A258367(k). I believe this was initially defined in Crandall et al. (1997) (in particular pp. 436-437) and it is now common practice for Wieferich searches to report primes with |A| below some predefined limit (for example, the ongoing search at PrimeGrid uses |A| <= 1000).

Examples

			n | a(n) | A006880(n) | a(n)/A006880(n)*100
--------------------------------------------
1 |    3 |          4 | 75.000000
2 |   15 |         25 | 60.000000
3 |   21 |        168 | 12.500000
4 |   29 |       1229 |  2.359642
5 |   34 |       9592 |  0.354462
6 |   35 |      78498 |  0.044587
7 |   36 |     664579 |  0.005417
8 |   36 |    5761455 |  0.000625
9 |   41 |   50847534 |  0.000081
		

Crossrefs

Programs

  • PARI
    a258367(n) = abs(centerlift(Mod(2, n^2)^((n-1)/2))\/n) \\ after Charles R Greathouse IV in A258367
    my(i=0, x=10); forprime(p=3, , if(p > x, print1(i, ", "); x=10*x); if(a258367(p) <= 10, i++))

A354676 a(n) = number of near-Wieferich primes with |A| <= 100 less than 10^n.

Original entry on oeis.org

3, 24, 105, 154, 213, 243, 268, 288, 307
Offset: 1

Views

Author

Felix Fröhlich, Jun 02 2022

Keywords

Comments

n | a(n) | A006880(n) | a(n)/A006880(n)*100
--------------------------------------------
1 | 3 | 4 | 75.000000
2 | 24 | 25 | 96.000000
3 | 105 | 168 | 62.500000
4 | 154 | 1229 | 12.530512
5 | 213 | 9592 | 2.220600
6 | 243 | 78498 | 0.309562
7 | 268 | 664579 | 0.040326
8 | 288 | 5761455 | 0.004998
9 | 307 | 50847534 | 0.000603

Crossrefs

Programs

  • PARI
    a258367(n) = abs(centerlift(Mod(2, n^2)^((n-1)/2))\/n) \\ after Charles R Greathouse IV in A258367
    my(i=0, x=10); forprime(p=3, , if(p > x, print1(i, ", "); x=10*x); if(a258367(p) <= 100, i++))

A354677 a(n) = number of near-Wieferich primes with |A| <= 1000 less than 10^n.

Original entry on oeis.org

3, 24, 167, 698, 1155, 1502, 1812, 2064, 2297
Offset: 1

Views

Author

Felix Fröhlich, Jun 02 2022

Keywords

Comments

n | a(n) | A006880(n) | a(n)/A006880(n)*100
--------------------------------------------
1 | 3 | 4 | 75.000000
2 | 24 | 25 | 96.000000
3 | 167 | 168 | 99.404761
4 | 698 | 1229 | 56.794141
5 | 1155 | 9592 | 12.041284
6 | 1502 | 78498 | 1.913424
7 | 1812 | 664579 | 0.272653
8 | 2064 | 5761455 | 0.035824
9 | 2297 | 50847534 | 0.004517

Crossrefs

Programs

  • PARI
    a258367(n) = abs(centerlift(Mod(2, n^2)^((n-1)/2))\/n) \\ after Charles R Greathouse IV in A258367
    my(i=0, x=10); forprime(p=3, , if(p > x, print1(i, ", "); x=10*x); if(a258367(p) <= 1000, i++))

A354678 a(n) = number of near-Wieferich primes with |A| <= 10000 less than 10^n.

Original entry on oeis.org

3, 24, 167, 1228, 5250, 8851, 11922, 14549, 16863
Offset: 1

Views

Author

Felix Fröhlich, Jun 02 2022

Keywords

Comments

n | a(n) | A006880(n) | a(n)/A006880(n)*100
---------------------------------------------
1 | 3 | 4 | 75.000000
2 | 24 | 25 | 96.000000
3 | 167 | 168 | 99.404761
4 | 1228 | 1229 | 99.918633
5 | 5250 | 9592 | 54.733110
6 | 8851 | 78498 | 11.275446
7 | 11922 | 664579 | 1.793917
8 | 14549 | 5761455 | 0.252523
9 | 16863 | 50847534 | 0.033163

Crossrefs

Programs

  • PARI
    a258367(n) = abs(centerlift(Mod(2, n^2)^((n-1)/2))\/n) \\ after Charles R Greathouse IV in A258367
    my(i=0, x=10); forprime(p=3, , if(p > x, print1(i, ", "); x=10*x); if(a258367(p) <= 10000, i++))

A250407 Near-Wilson primes (p = prime(n) satisfying (p-1)! == -1-A250406(n)*p (mod p^2)) with A250406(n) < 10.

Original entry on oeis.org

2, 3, 5, 7, 13, 61, 71, 79, 157, 281, 563, 1277, 1777, 2339, 6311, 8233, 8543, 11047, 22907, 27689
Offset: 1

Views

Author

Felix Fröhlich, Nov 22 2014

Keywords

Comments

A250406(n) is essentially A007619(n) modulo A000040(n) (see Crandall et al. (1997), p. 442).

Crossrefs

Programs

  • PARI
    forprime(p=1, 1e9, for(b=0, 9, if(Mod((p-1)!, p^2)==-1-b*p, print1(p, ", "); break({1}))))

A319314 Numbers k such that 2^phi(k) == phi(k)^2 (mod k^2).

Original entry on oeis.org

1, 3, 4, 5, 6, 8, 10, 12, 384, 640, 768, 896, 960, 24576, 49152, 950272, 1425408, 1572864, 3145728, 10485760, 19398656, 65011712, 100663296, 110057537, 201326592, 220115074, 671088640, 1879048192
Offset: 1

Views

Author

Altug Alkan, Sep 17 2018

Keywords

Comments

Sequence is infinite, i.e., 3*2^(3*(t-1)-(-1)^t) is a term for all t > 0.
Prime terms (5, 110057537, ...) are in A246568 based on case A = +1.

Crossrefs

Programs

  • Magma
    [1] cat [n: n in [1..10^6] | 2^EulerPhi(n) mod n^2 eq EulerPhi(n)^2]; // Vincenzo Librandi, Sep 20 2018
  • PARI
    isok(n) = Mod(2, n^2)^eulerphi(n)==eulerphi(n)^2;
    

A385856 Near-Wieferich primes (primes p satisfying 2^p == 2 + A*p (mod p^2)) with |A| <= 10.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 29, 37, 41, 43, 47, 71, 157, 173, 211, 251, 263, 379, 383, 1093, 1097, 1699, 1753, 2633, 2659, 3373, 3511, 3593, 5501, 8089, 10691, 15823, 27967, 30577, 45827, 46477, 1437049, 1483597, 1897121, 2152849, 6266543, 52368101, 110057537, 126233057, 1683955849, 2001907169, 13211006161, 47004625957
Offset: 1

Views

Author

A. Lamek, Jul 10 2025

Keywords

Comments

Near-Wieferich primes: 2^p == 2 + A*p (mod p^2) for |A| <= 10. Extends the Wieferich condition by allowing small symmetric offsets.
See also A246568 for a related formulation involving the same congruence structure.
All values verified for p <= 5*10^10.

Examples

			p=11: 2^11 == 2048 == 2+(-1)*11 == -9 == 112 (mod 121), so A=-1.
p=5: 2^5 == 32 == 2+1*5 == 7 (mod 25), so A=1.
		

Crossrefs

Programs

  • Mathematica
    isokQ[p_] := Module[{A}, A = Quotient[PowerMod[2, p, p^2] - 2, p]; A <= 10 || p - A <= 10]
  • PARI
    isok(p) = lift(Mod(2, p^2)^p-2+10*p) <= 20*p; \\ Michel Marcus, Jul 12 2025
  • Python
    def is_a385856(p):
        A = ((pow(2, p, p*p)-2) // p) % p
        return (A<=10) or (p-A<=10)
    

Extensions

a(44)-a(46) from Michel Marcus, Jul 12 2025
a(48) from Jinyuan Wang, Jul 13 2025
Showing 1-10 of 10 results.