OFFSET
1,2
LINKS
Gerald Hillier, Table of n, a(n) for n = 1..1000
FORMULA
Set R(N)=N+ROUND(SQRT(N),0), S(N)=FLOOR(SQRT(R(N))), U(N)=R(N)*(R(N)+1)/2-S(N)*(S(N)+1)*(S(N)+.5)/3, T(N)=CEILING(N/2), then a(N)=T(N)*(1+T(N)*(3+2*T(N)))/6+U(FLOOR(N/2))
EXAMPLE
a(14)=1+2+4+3+9+5+16+6+25+7+36+8+49+10=181
MATHEMATICA
Module[{nn=40, sq, int, len}, sq=Range[nn]^2; int=Complement[Range[nn], sq]; len=Min[ Length[ int], nn]; Riffle[Take[ sq, len], Take[ int, len]]]//Accumulate (* Harvey P. Dale, Jun 11 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gerald Hillier, Nov 02 2009
EXTENSIONS
Terms a(15) and above from Gerald Hillier, Jan 06 2022
STATUS
approved