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-1 of 1 results.

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.

Original entry on oeis.org

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

Views

Author

William Lewis Craig, Mar 01 2017

Keywords

Comments

For a given prime p, it has been proved that the set of all n for which p^2 divides n^n + (-1)^n (n-1)^(n-1) is some set of residue classes mod p(p-1). Therefore testing all values of n up to p(p-1) will determine whether p is in this list.
There are far more efficient ways to determine if p is indeed in the list, described by Boyd, Martin, and Thom in their paper.

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
Showing 1-1 of 1 results.