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

%I #21 Feb 10 2023 14:29:06

%S 0,0,0,2,1,2,6,2,0,4,6,2,6,0,6,2,6,2,6,18,15,14,6,2,1,14,0,14,6,14,6,

%T 2,3,14,31,2,6,14,36,18,6,38,6,10,36,14,6,2,13,24,36,46,6,2,1,42,36,

%U 14,6,38,6,14,36,2,16,2,6,30,36,14,6,2,6,14,51,22,17,14,6,18,0,14,6,38,21

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

%H Seiichi Manyama, <a href="/A341409/b341409.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A001550(n) mod n.

%F a(A056645(n)) = 0.

%p a:= n-> add(i&^n, i=1..3) mod n:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Feb 11 2021

%t a[n_] := Mod[Sum[k^n, {k, 1, 3}], n]; Array[a, 100] (* _Amiram Eldar_, Feb 11 2021 *)

%o (PARI) a(n) = sum(k=1, 3, k^n)%n;

%Y (Sum_{k=1..m} k^n) mod n: A096196 (m=2), this sequence (m=3), A341410 (m=4), A341411 (m=5), A341412 (m=6), A341413 (m=7).

%Y Cf. A001550, A045576, A056645, A220235.

%K nonn,easy

%O 1,4

%A _Seiichi Manyama_, Feb 11 2021