OFFSET
0,3
FORMULA
a(0)=0, a(n) = max(min(a(n-1)+x, n+a(n-x))), where the maximum is taken over all values for x from 1 to n.
a(n) = Sum_{k=1..n} floor(sqrt(k)+1/2). - Wesley Ivan Hurt, Dec 01 2020
a(n) = (1/3)*t*(3*n + 1 - t^2), where t = floor(sqrt(n)+1/2). - Ridouane Oudra, Feb 22 2021
MATHEMATICA
f[n_]:=Round[Sqrt[n]]; a=0; lst={}; Do[AppendTo[lst, a+=f[n]], {n, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Oct 13 2009 *)
Table[Sum[Floor[Sqrt[n + 1 - k] + 1/2], {k, n + 1}], {n, 0, 100}] (* Wesley Ivan Hurt, Dec 01 2020 *)
PROG
(Python)
from math import isqrt
def A165453(n): return (k:=(m:=isqrt(n))+(n-m*(m+1)>=1))*(3*n+1-k**2)//3 # Chai Wah Wu, Jun 19 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Friedrich Regen (friedrich.regen(AT)tu-ilmenau.de), Sep 20 2009
STATUS
approved