login
A156558
a(n) = Sum_{k=1..n} (n^k mod (n-k+1)).
4
0, 0, 0, 1, 1, 4, 1, 7, 5, 11, 10, 18, 11, 31, 22, 31, 39, 61, 51, 46, 55, 79, 73, 95, 84, 119, 122, 123, 118, 149, 82, 194, 186, 203, 182, 221, 169, 226, 257, 251, 287, 290, 242, 315, 338, 361, 420, 439, 399, 373, 362, 450, 616, 525, 536, 515, 514, 699, 669, 664
OFFSET
0,6
LINKS
MAPLE
P:=proc(i) local a, n; for n from 0 by 1 to i do a:=sum('(n^k mod (n-k+1))', 'k'=1..n); print(a); od; end: P(100);
MATHEMATICA
Table[Sum[PowerMod[n, k, n-k+1], {k, n}], {n, 0, 60}] (* Harvey P. Dale, Dec 12 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, n^k%(n-k+1)); \\ Jinyuan Wang, Aug 02 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved