OFFSET
0,2
COMMENTS
Row sums of nonsquare integers (A000037), seen as a regular triangle:
.
2 | 2,
8 | 3, 5,
21 | 6, 7, 8,
46 | 10, 11, 12, 13,
83 | 14, 15, 17, 18, 19,
136 | 20, 21, 22, 23, 24, 26,
210 | 27, 28, 29, 30, 31, 32, 33,
306 | 34, 35, 37, 38, 39, 40, 41, 42,
...
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
MAPLE
R:= 0: s:= 1:
for n from 1 to 100 do
if floor(sqrt(s+n)) = floor(sqrt(s)) then
R:= R, n*s + n*(n+1)/2; s:= s+n;
else
R:= R, n*s + n*(n+1)/2 - floor(sqrt(s+n))^2 + s+n+1; s:= s+n+1;
fi
od:
R; # Robert Israel, Oct 02 2022
MATHEMATICA
Table[Sum[
i + Floor[1/2 + Sqrt[i]], {i, n (n - 1)/2 + 1, (n + 1) (n)/2}], {n,
0, 40}]
Join[{0}, Module[{nn=1000, nsi, len}, nsi=Select[Range[nn], !IntegerQ[Sqrt[#]]&]; len=Floor[ (Sqrt[ 8*Length[nsi]+1]-1)/2]; Total/@TakeList[nsi, Range[len]]]] (* Harvey P. Dale, Jan 04 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Olivier Gérard, Aug 07 2016
EXTENSIONS
Definition clarified by Harvey P. Dale, Jan 04 2024
STATUS
approved