This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A338546 #20 Jul 19 2021 01:22:37 %S A338546 1,2,3,6,9,11,15,21,24,28,36,42,46,55,65,70,78,91,99,105,120,133,140, %T A338546 153,171,180,190,210,225,234,253,275,285,300,325,341,352,378,402,414, %U A338546 435,465,481,496,528,553,567,595,630,645,666,703,728,744,780,816 %N A338546 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 A338546 The sequence of 1's and 0's is more formally defined as A118175. %e A338546 Equivalently, this is the number of 1's up to the n-th row of a triangle filled with A118175: %e A338546 1 (1) %e A338546 01 (2) %e A338546 100 (3) %e A338546 1110 (6) %e A338546 00111 (9) %e A338546 100001 (11) %e A338546 1111000 (15) %e A338546 00111111 (21) %e A338546 000000111 (24) %e A338546 1111000000 (28) %e A338546 01111111100 (36) %e A338546 000000111111 (42) %e A338546 ... %t A338546 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 A338546 (PARI) f(n) = my(r=sqrt(n)); 1 - ceil(r) + round(r); %o A338546 a(n) = sum(k=1, n*(n+1)/2, f(k)==1); \\ _Michel Marcus_, Nov 12 2020 %Y A338546 Based on A118175 and A000217. %K A338546 nonn %O A338546 1,2 %A A338546 _Arnauld Chevallier_, Nov 02 2020