login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = Sum_{k=1..n} (n^k mod (n-k+1)).
4

%I #11 Dec 12 2021 11:25:22

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

%T 119,122,123,118,149,82,194,186,203,182,221,169,226,257,251,287,290,

%U 242,315,338,361,420,439,399,373,362,450,616,525,536,515,514,699,669,664

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

%H Harvey P. Dale, <a href="/A156558/b156558.txt">Table of n, a(n) for n = 0..1000</a>

%p 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);

%t Table[Sum[PowerMod[n,k,n-k+1],{k,n}],{n,0,60}] (* _Harvey P. Dale_, Dec 12 2021 *)

%o (PARI) a(n) = sum(k=1, n, n^k%(n-k+1)); \\ _Jinyuan Wang_, Aug 02 2021

%Y Cf. A156556, A156557, A156559.

%K nonn,easy

%O 0,6

%A _Paolo P. Lava_ and _Giorgio Balzarotti_, Feb 10 2009