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

A024921
a(n) = Sum_{k=1..n} floor((n/k)*floor(n/k)).
1
1, 5, 11, 22, 33, 52, 67, 93, 117, 149, 174, 219, 250, 293, 339, 392, 434, 500, 546, 619, 680, 748, 804, 903, 969, 1051, 1131, 1230, 1301, 1422, 1497, 1609, 1708, 1814, 1915, 2062, 2156, 2275, 2388, 2543, 2646, 2808, 2915, 3070, 3219, 3359, 3480, 3683, 3813, 3985, 4137
OFFSET
1,2
LINKS
FORMULA
a(n) = n^2*Pi^2/6 + O(n*log n) as n -> infinity. - Robert Israel, Aug 05 2016
MAPLE
f:= n -> add(floor(n/k*floor(n/k)), k=1..n):
map(f, [$1..1000]); # Robert Israel, Aug 05 2016
MATHEMATICA
Table[Sum[Floor[(n / k) Floor[n / k]], {k, 1, n}], {n, 1, 50}] (* Vincenzo Librandi, Jul 28 2019 *)
PROG
(PARI) a(n) = sum(k=1, n, floor((n/k)*floor(n/k))) \\ Michel Marcus, Mar 23 2013
(Magma) [&+[(n div k)*(n div k): k in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Jul 28 2019
CROSSREFS
Sequence in context: A184552 A069097 A222548 * A189978 A192761 A152533
KEYWORD
nonn
STATUS
approved