login

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”).

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