Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 May 05 2021 01:54:08
%S 0,1,0,0,2,5,6,4,8,7,0,4,10,3,10,4,12,15,3,4,3,19,2,20,11,3,23,16,15,
%T 1,11,4,1,9,24,12,1,11,36,28,26,41,5,12,20,45,26,4,5,35,16,32,48,45,
%U 23,44,51,23,3,32,29,25,44,4,24,19,64,56,28,29,44,60,54,71,12,24,51,65,55,36,68,21,1,40,38
%N a(n) = (Sum_{k=1..n} (-k)^k) mod n.
%H Seiichi Manyama, <a href="/A343933/b343933.txt">Table of n, a(n) for n = 1..10000</a>
%t a[n_] := Mod[Sum[PowerMod[-k, k, n], {k, 1, n}], n]; Array[a, 100] (* _Amiram Eldar_, May 04 2021 *)
%o (PARI) a(n) = sum(k=1, n, (-k)^k)%n;
%Y Cf. A341437, A343930, A343931.
%K nonn,easy
%O 1,5
%A _Seiichi Manyama_, May 04 2021