A270776 Smallest non-Wieferich prime to base n, i.e., smallest prime p such that n^(p-1) != 1 (mod p^2).
2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2
Offset: 2
Keywords
Examples
The sequence of base-17 Wieferich primes (A128668) starts 2, 3, 46021. Thus the smallest non-Wieferich prime to base 17 is 5 and hence a(17) = 5.
Links
- Felix Fröhlich, Table of n, a(n) for n = 2..10000
- K. A. Broughan, Relaxations of the abc conjecture using integer k'th roots, New Zealand Journal of Mathematics, 35 (2006), 121-136.
Programs
-
Mathematica
A270776[n_] := NestWhile[#+1 &, 2, CompositeQ[#] || PowerMod[n, #-1, #^2] == 1 &]; Array[A270776, 100, 2] (* Paolo Xausa, Aug 15 2025 *)
-
PARI
a(n) = forprime(p=1, , if(Mod(n, p^2)^(p-1)!=1, return(p)))
Comments