A271782
Smallest n-Wall-Sun-Sun prime.
Original entry on oeis.org
13, 241, 2, 3, 191, 5, 2, 3, 2683
Offset: 2
Cf.
A001177,
A039951,
A113649,
A113650,
A113651,
A214028,
A237517,
A237835,
A241014,
A244801,
A253247,
A268478.
-
A271782(k) = forprime(p=2,10^8, if( (([0,1;1,k]*Mod(1,p^2))^(p-kronecker(k^2+4,p)))[1,2]==0, return(p);); ); \\ Max Alekseyev, Apr 22 2016, corrected by Richard N. Smith, Jul 16 2019 to include p=2 and p divides k^2+4
A281001
Square array read by antidiagonals downwards: A(n, 1) = smallest Wieferich prime to base n and A(n, k) = smallest Wieferich prime to base A(n, k-1) for k > 1.
Original entry on oeis.org
1093, 2, 11, 1093, 71, 1093, 2, 3, 2, 2, 1093, 11, 1093, 1093, 66161, 2, 71, 2, 2, 2, 5, 1093, 3, 1093, 1093, 1093, 2, 3, 2, 11, 2, 2, 2, 1093, 11, 2, 1093, 71, 1093, 1093, 1093, 2, 71, 1093, 3, 2, 3, 2, 2, 2, 1093, 3, 2, 11, 71, 1093, 11, 1093, 1093, 1093, 2
Offset: 2
Array starts
1093, 2, 1093, 2, 1093, 2, ...
11, 71, 3, 11, 71, 3, ...
1093, 2, 1093, 2, 1093, 2, ...
2, 1093, 2, 1093, 2, 1093, ...
66161, 2, 1093, 2, 1093, 2, ...
5, 2, 1093, 2, 1093, 2, ...
....
-
smallestwieftobase(n) = forprime(p=1, , if(Mod(n, p^2)^(p-1)==1, return(p)))
table(rows, cols) = for(x=2, rows+1, my(i=0, w=smallestwieftobase(x)); while(i < cols, print1(w, ", "); w=smallestwieftobase(w); i++); print(""))
table(7, 5) \\ print initial 5 terms of upper 7 rows of array
A178813
a(n) = (prime(n)^(p-1) - 1)/p^2 mod p, where p is the first prime that divides (prime(n)^(p-1) - 1)/p.
Original entry on oeis.org
487, 4, 1, 1, 46, 1, 0, 1, 11, 1, 2, 1, 0, 2
Offset: 1
Prime(2) = 3 and the first prime p that divides (3^(p-1) - 1)/p is 11, so a(2) = (3^10 - 1)/11^2 mod 11 = 488 mod 11 = 4.
-
Table[If[IntegerQ[s[[2]]],s,{s[[1]], "no solution in range 1 <= k <= 10^5"}], {s,Table[k = 1;Monitor[Parallelize[While[k <= 10^5,If[IntegerQ[((Prime[n]^(Prime[k] - 1) - 1)/Prime[k])/Prime[k]],Break[]]; k++];{n, Mod[(Prime[n]^(Prime[k] - 1) - 1)/Prime[k]^2, Prime[k]]}],k], {n, 1, 10}]}] (* J.W.L. (Jan) Eerland, Sep 27 2024 *)
A269111
a(n) = length of the repeating part of row n of A288097.
Original entry on oeis.org
2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2
Offset: 1
The trajectory of 31 starts 31, 7, 5, 2, 1093, 2, 1093, 2, 1093, ...., entering a repeating cycle of length 2, so a(11) = 2.
-
Table[Length@ DeleteCases[Values@ PositionIndex@ NestList[Function[n, Block[{p = 2}, While[! Divisible[n^(p - 1) - 1, p^2], p = NextPrime@ p]; p]], Prime@ n, 12], ?(Length@ # == 1 &)], {n, 12}] (* _Michael De Vlieger, Jun 06 2017, Version 10 *)
-
a039951(n) = forprime(p=1, , if(Mod(n, p^2)^(p-1)==1, return(p)))
trajectory(n, terms) = my(v=[n]); while(#v < terms, v=concat(v, a039951(v[#v]))); v
a(n) = my(p=prime(n), i=0, len=2, t=trajectory(p, len), k=#t); while(1, while(k > 1, k--; if(t[k]==t[#t], return(#t-k))); len++; t=trajectory(p, len); k=#t) \\ Felix Fröhlich, Jan 14 2017
A270776
Smallest non-Wieferich prime to base n, i.e., smallest prime p such that n^(p-1) != 1 (mod p^2).
Original entry on oeis.org
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
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.
-
A270776[n_] := NestWhile[#+1 &, 2, CompositeQ[#] || PowerMod[n, #-1, #^2] == 1 &];
Array[A270776, 100, 2] (* Paolo Xausa, Aug 15 2025 *)
-
a(n) = forprime(p=1, , if(Mod(n, p^2)^(p-1)!=1, return(p)))
A278611
Bases b > 1 that set a new record for the size of the smallest base-b Wieferich prime.
Original entry on oeis.org
a(2) = 6, since the smallest base-6 Wieferich prime is 66161 and that prime is the second term with a record value in A039951.
-
smallest_w_prime(n) = forprime(p=1, , if(Mod(n, p^2)^(p-1)==1, return(p)))
my(r=0, b=2); while(1, if(smallest_w_prime(b) > r, print1(b, ", "); r=smallest_w_prime(b)); b++)
A288097
Square array read by antidiagonals downwards: A(n, 1) = smallest base-prime(n) Wieferich prime and A(n, k) = smallest base-A(n, k-1) Wieferich prime for k > 1.
Original entry on oeis.org
1093, 2, 11, 1093, 71, 2, 2, 3, 1093, 5, 1093, 11, 2, 2, 71, 2, 71, 1093, 1093, 3, 2, 1093, 3, 2, 2, 11, 1093, 2, 2, 11, 1093, 1093, 71, 2, 1093, 3, 1093, 71, 2, 2, 3, 1093, 2, 11, 13, 2, 3, 1093, 1093, 11, 2, 1093, 71, 2, 2, 1093, 11, 2, 2, 71, 1093, 2, 3, 1093, 1093, 7
Offset: 1
Array starts
1093, 2, 1093, 2, 1093, 2, 1093, 2, 1093, 2
11, 71, 3, 11, 71, 3, 11, 71, 3, 11
2, 1093, 2, 1093, 2, 1093, 2, 1093, 2, 1093
5, 2, 1093, 2, 1093, 2, 1093, 2, 1093, 2
71, 3, 11, 71, 3, 11, 71, 3, 11, 71
2, 1093, 2, 1093, 2, 1093, 2, 1093, 2, 1093
2, 1093, 2, 1093, 2, 1093, 2, 1093, 2, 1093
3, 11, 71, 3, 11, 71, 3, 11, 71, 3
13, 2, 1093, 2, 1093, 2, 1093, 2, 1093, 2
2, 1093, 2, 1093, 2, 1093, 2, 1093, 2, 1093
-
f[n_] := Block[{p = 2}, While[! Divisible[n^(p - 1) - 1, p^2], p = NextPrime@ p]; p]; T[n_, k_] := T[n, k] = If[k == 1, f@ Prime@ n, f@ T[n, k - 1]]; Table[Function[n, T[n, k]][m - k + 1], {m, 12}, {k, m, 1, -1}] // Flatten (* Michael De Vlieger, Jun 06 2017 *)
-
a039951(n) = forprime(p=1, , if(Mod(n, p^2)^(p-1)==1, return(p)))
table(rows, cols) = forprime(p=1, prime(rows), my(i=0, w=a039951(p)); while(i < cols, print1(w, ", "); w=a039951(w); i++); print(""))
table(10, 10) \\ print initial 10 rows and 10 columns of table
A331424
Prime numbers p such that p^2 divides 31^(p-1) - 1.
Original entry on oeis.org
7, 79, 6451, 2806861
Offset: 1
- Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 233.
Wieferich primes to base b:
A001220 (b=2),
A014127 (b=3),
A123692 (b=5),
A123693 (b=7),
A128667 (b=13),
A128668 (b=17),
A090968 (b=19),
A128669 (b=23), this sequence (b=31),
A331426 (b=37),
A331427 (b=41).
-
Select[Range[3*10^6], PrimeQ[#] && PowerMod[31, # - 1, #^2] == 1 &] (* Amiram Eldar, May 05 2021 *)
-
forprime(p=2, 1e8, if(Mod(31, p^2)^(p-1)==1, print1(p", ")))
A331426
Prime numbers p such that p^2 divides 37^(p-1) - 1.
Original entry on oeis.org
2, 3, 77867, 76407520781
Offset: 1
- Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 233.
Wieferich primes to base b:
A001220 (b=2),
A014127 (b=3),
A123692 (b=5),
A123693 (b=7),
A128667 (b=13),
A128668 (b=17),
A090968 (b=19),
A128669 (b=23),
A331424 (b=31), this sequence (b=37),
A331427 (b=41).
-
Select[Range[10^5], PrimeQ[#] && PowerMod[37, # - 1, #^2] == 1 &] (* Amiram Eldar, May 05 2021 *)
-
forprime(p=2, 1e8, if(Mod(37, p^2)^(p-1)==1, print1(p", ")))
A331427
Prime numbers p such that p^2 divides 41^(p-1) - 1.
Original entry on oeis.org
2, 29, 1025273, 138200401
Offset: 1
- Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 233.
Wieferich primes to base b:
A001220 (b=2),
A014127 (b=3),
A123692 (b=5),
A123693 (b=7),
A128667 (b=13),
A128668 (b=17),
A090968 (b=19),
A128669 (b=23),
A331424 (b=31),
A331426 (b=37), this sequence (b=41).
-
Select[Range[1.1*10^6], PrimeQ[#] && PowerMod[41, # - 1, #^2] == 1 &] (* Amiram Eldar, May 05 2021 *)
-
forprime(p=2, 1e8, if(Mod(41, p^2)^(p-1)==1, print1(p", ")))
Comments