login
a(n) = (Sum_{k=1..2n} k^2n) mod 2n.
3

%I #42 Oct 27 2023 21:56:36

%S 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,

%T 29,58,31,32,11,34,35,12,37,38,13,24,41,2,43,44,15,46,47,16,49,30,17,

%U 52,53,18,45,56,19,58,59,116,61,62,3,64,65,22,67,68,23

%N a(n) = (Sum_{k=1..2n} k^2n) mod 2n.

%C Sum_{k=1..n} k^n (mod n) = 0 if n odd.

%C Properties of this sequence:

%C a(n) = 1 for n = 1, 3, 21, 903, ...

%C a(n) = n if n not divisible by 3;

%C a(3*n) = n except for n = 7, 10, 14, 20, 21, 26, 28, 30, 35, ...

%C a(21*n) = n, except for n = 10, 20, 26, 30, 40, 43, 50, 52, ...

%C a(903*n) = n, except for n = 10, ....

%C It appears that a(A007018(n)/2) = 1 and conjecturally a(m*A007018(n)/2) = m for a majority of value m.

%C No, a(A007018(n)/2) <> 1 for n > 4. (For example, a(A007018(5)/2) = a(1631721) = 1807.) - _Jonathan Sondow_, Oct 18 2013

%C 0 < a(n) < 10 for n: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 18, 21, 24, 27, 42, 63, 84, 105, 126, 147, 168, 189, 903, 1806, 2709, 3612, 4515, 5418, 6321, 7224, 8127, .... Search limit was 25000. - _Robert G. Wilson v_, Jun 18 2015

%H Alois P. Heinz, <a href="/A182398/b182398.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..2499 from Michel Lagneau)

%H J. M. Grau, A. M. Oller-Marcen, and J. Sondow, <a href="http://arxiv.org/abs/1309.7941">On the congruence 1^m + 2^m + ... + m^m == n (mod m) with n|m</a>, arXiv 1309.7941, 2013.

%H Mathematics Stack Exchange, <a href="http://math.stackexchange.com/questions/511444/1n-2n-cdots-p-1n-mod-p">1^n + 2^n + ... + (p-1)^n mod p = ?</a>

%F a(n) = A031971(2n) mod 2n. - _Jonathan Sondow_, Oct 18 2013

%p for n from 1 to 100 do: s:=sum('k^(2*n)', 'k'=1..2*n)

%p : x:=irem(s,2*n): printf(`%d, `,x):od:

%p # second Maple program:

%p a:= n-> add(k&^(2*n) mod (2*n), k=1..2*n) mod (2*n):

%p seq(a(n), n=1..100);

%t Table[Mod[Total[PowerMod[Range[2*n], 2*n, 2*n]], 2*n], {n, 100}] (* _T. D. Noe_, Apr 28 2012 *)

%Y Cf. A007018, A014117, A031971, A229307, A229311.

%K nonn

%O 1,2

%A _Michel Lagneau_, Apr 27 2012