A182398 a(n) = (Sum_{k=1..2n} k^2n) mod 2n.
1, 2, 1, 4, 5, 2, 7, 8, 3, 6, 11, 4, 13, 14, 5, 16, 17, 6, 19, 12, 1, 22, 23, 8, 25, 26, 9, 28, 29, 58, 31, 32, 11, 34, 35, 12, 37, 38, 13, 24, 41, 2, 43, 44, 15, 46, 47, 16, 49, 30, 17, 52, 53, 18, 45, 56, 19, 58, 59, 116, 61, 62, 3, 64, 65, 22, 67, 68, 23
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (terms 1..2499 from Michel Lagneau)
- J. M. Grau, A. M. Oller-Marcen, and J. Sondow, On the congruence 1^m + 2^m + ... + m^m == n (mod m) with n|m, arXiv 1309.7941, 2013.
- Mathematics Stack Exchange, 1^n + 2^n + ... + (p-1)^n mod p = ?
Programs
-
Maple
for n from 1 to 100 do: s:=sum('k^(2*n)', 'k'=1..2*n) : x:=irem(s,2*n): printf(`%d, `,x):od: # second Maple program: a:= n-> add(k&^(2*n) mod (2*n), k=1..2*n) mod (2*n): seq(a(n), n=1..100);
-
Mathematica
Table[Mod[Total[PowerMod[Range[2*n], 2*n, 2*n]], 2*n], {n, 100}] (* T. D. Noe, Apr 28 2012 *)
Formula
a(n) = A031971(2n) mod 2n. - Jonathan Sondow, Oct 18 2013
Comments