A226960 Numbers n such that 1^n + 2^n + 3^n +...+ n^n == 2 (mod n).
1, 4, 12, 84, 3612
Offset: 1
Links
- M. A. Alekseyev, J. M. Grau, A. M. Oller-Marcen. Computing solutions to the congruence 1^n + 2^n + ... + n^n == p (mod n). Discrete Applied Mathematics, 2018. doi:10.1016/j.dam.2018.05.022 arXiv:1602.02407 [math.NT]
Crossrefs
Subsequence of A124240.
Programs
-
Mathematica
Select[Range[10000], Mod[Sum[PowerMod[i, #, #], {i, #}], #] == 2 &]
-
PARI
is(n)=if(n%2,return(n==1)); Mod(sumdiv(n/2,d, if(isprime(2*d+1), n/(2*d+1)))+n/2,n)==-2 \\ Charles R Greathouse IV, Nov 13 2013
Extensions
a(1)=1 prepended by Max Alekseyev, Aug 25 2013
Comments