Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #20 Jul 19 2021 01:22:37
%S 1,2,3,6,9,11,15,21,24,28,36,42,46,55,65,70,78,91,99,105,120,133,140,
%T 153,171,180,190,210,225,234,253,275,285,300,325,341,352,378,402,414,
%U 435,465,481,496,528,553,567,595,630,645,666,703,728,744,780,816
%N For n > 0, a(n) is the number of 1's among the first T(n) terms of the sequence 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, ..., k 1's, k 0's, where T(n) is the n-th triangular number.
%C The sequence of 1's and 0's is more formally defined as A118175.
%e Equivalently, this is the number of 1's up to the n-th row of a triangle filled with A118175:
%e 1 (1)
%e 01 (2)
%e 100 (3)
%e 1110 (6)
%e 00111 (9)
%e 100001 (11)
%e 1111000 (15)
%e 00111111 (21)
%e 000000111 (24)
%e 1111000000 (28)
%e 01111111100 (36)
%e 000000111111 (42)
%e ...
%t 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 *)
%o (PARI) f(n) = my(r=sqrt(n)); 1 - ceil(r) + round(r);
%o a(n) = sum(k=1, n*(n+1)/2, f(k)==1); \\ _Michel Marcus_, Nov 12 2020
%Y Based on A118175 and A000217.
%K nonn
%O 1,2
%A _Arnauld Chevallier_, Nov 02 2020