A283146 Prime numbers p whose square divides a number of the form n^n + (-1)^n (n-1)^(n-1), where n is a positive integer.
59, 83, 179, 193, 337, 419, 421, 443, 457, 547, 601, 619, 701, 787, 857, 887, 911, 929, 977, 1039, 1091, 1093, 1109, 1193, 1217, 1223, 1237, 1259, 1289, 1439, 1487, 1489, 1493, 1613, 1637, 1657, 1811, 1847, 1901, 1993, 1997, 2003, 2087, 2089, 2113, 2377, 2389, 2423, 2437, 2477
Offset: 1
Keywords
Links
- William Lewis Craig, Table of n, a(n) for n = 1..10052
- David W. Boyd, Greg Martin, and Mark Thom, Squarefree values of trinomial discriminants, arXiv 1402.5148 [math.NT], 2014.
Crossrefs
Values of n for which square divisors occur are A238194.
Programs
-
Mathematica
Reap[For[p = 2, p < 1000, p = NextPrime[p], If[AnyTrue[Range[2, p(p-1)], Mod[PowerMod[#, #, p^2] + (-1)^# PowerMod[#-1, #-1, p^2], p^2] == 0&], Print[p]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
-
PARI
isok(p) = {for (n=2, p*(p-1), if (((n^n + (-1)^n*(n-1)^(n-1)) % p^2) == 0, return (1)););} lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", "))) \\ Michel Marcus, Aug 01 2017
Comments