%I #35 Sep 08 2022 08:44:39
%S 1,2,4,7,9,13,18,24,29,34,42,51,57,67,78,90,97,110,122,137,149,163,
%T 180,198,211,226,246,265,281,303,324,348,365,386,412,439,457,483,512,
%U 540,561,590,618,651,679,709,742
%N a(n) = Sum_{k=1..n} floor(k^2/n).
%D M. Eichler and D. Zagier, The Theory of Jacobi Forms, Birkhauser, 1985, p. 103.
%H G. C. Greubel, <a href="/A014817/b014817.txt">Table of n, a(n) for n = 1..5000</a>
%F a(n) = n +A166375(n).
%F For prime p>2, a(p) = (p^2+2)/3 - A228131(p)/p. In particular, for prime p==1 (mod 4), a(p) = (p^2+2)/3. - _Max Alekseyev_, Aug 11 2013
%e Row sums of the underlying triangle of floor(k^2/n), 1<=k<=n:
%e 1;
%e 0,2;
%e 0,1,3;
%e 0,1,2,4;
%e 0,0,1,3,5;
%e 0,0,1,2,4,6;
%e 0,0,1,2,3,5,7;
%e 0,0,1,2,3,4,6,8;
%e 0,0,1,1,2,4,5,7,9;
%e 0,0,0,1,2,3,4,6,8,10;
%e - _R. J. Mathar_, Aug 09 2013
%p A014817 := m->sum( floor(k^2/m), k=1..m);
%t Table[Sum[Floor[k^2/n],{k,n}],{n,50}] (* _Harvey P. Dale_, Feb 23 2015 *)
%o (PARI) A014817(n)=sum(k=1,n,k^2\n) \\ _M. F. Hasler_, Dec 11 2010
%o (PARI) a(n)=n^2-sum(m=1,n,sqrtint(n*m-1)) \\ _Charles R Greathouse IV_, Jun 20 2013
%o (Magma) [(&+[Floor(k^2/n): k in [1..n]]): n in [1..50]]; // _G. C. Greubel_, May 10 2018
%Y Cf. A177041, A166387, A166375, A165993, A227841, A227842.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_