OFFSET
1,2
COMMENTS
The sequence of 1's and 0's is more formally defined as A118175.
EXAMPLE
Equivalently, this is the number of 1's up to the n-th row of a triangle filled with A118175:
1 (1)
01 (2)
100 (3)
1110 (6)
00111 (9)
100001 (11)
1111000 (15)
00111111 (21)
000000111 (24)
1111000000 (28)
01111111100 (36)
000000111111 (42)
...
MATHEMATICA
With[{nn = 56}, Accumulate@ Map[Total, TakeList[Array[1 - Ceiling[#] + Round[#] &@ Sqrt[#] &, PolygonalNumber[nn]], Range[nn]]]] (* Michael De Vlieger, Nov 02 2020, after Branko Curgus at A118175 *)
PROG
(PARI) f(n) = my(r=sqrt(n)); 1 - ceil(r) + round(r);
a(n) = sum(k=1, n*(n+1)/2, f(k)==1); \\ Michel Marcus, Nov 12 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Arnauld Chevallier, Nov 02 2020
STATUS
approved