OFFSET
1,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
FORMULA
a(n) = B*(B+1)/2 - C*(C+1) - a(C) where B = floor(sqrt(2)*n) and C = floor(B/(sqrt(2)+2)). - M. F. Hasler, Apr 23 2022
MATHEMATICA
a[n_]:=Sum[Floor[j*Sqrt[2]], {j, 1, n}]; Table[a[n], {n, 1, 90}]
PROG
(PARI) apply( A194102(n)=sum(k=1, n, sqrtint(k^2*2)), [1..99]) \\ M. F. Hasler, Jan 16 2021
(PARI) apply( {A194102(n)=if(n>1, (1+n=sqrtint(n^2*2))*n\2-A194102(n-=sqrtint(n^2\2)+1)-(1+n)*n, n)}, [1..99]) \\ M. F. Hasler, Apr 23 2022
(Magma) [(&+[Floor(k*Sqrt(2)): k in [1..n]]): n in [1..100]]; // G. C. Greubel, Jun 05 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Aug 15 2011
STATUS
approved