Not so triangular numbers
Jelly, 9 bytes
ḤR&gt;)FŒHṪS

A monadic Link accepting \$n\$ which yields \$a(n)\$.
Try it online! Or see the test-suite.
How?
We can think of \$S\$ as being built in blocks of length \$2i\$ where each block is a string of \$i\$ ones followed by \$i\$ zeros: 10 1100 111000 ....
If we stop at \$i=x\$ and call the result \$S_x\$ we know that \$S_x\$ necessarily contains an equal number of ones and zeros.
We also know that the length of \$S_x\$ will be  \$\sum_{i=1}^{x}2i = 2 \sum_{i=1}^{x}i = 2T(x)\$.
So the value of \$a(x)\$ is the count of ones in the first half of \$S_x\$.
An alternative way to get this same result is to subtract the count of the zeros in the first half of \$S_x\$ from \$T(x)\$, and since \$S_x\$ contains an equal number of ones and zeros this must also be the count of zeros in the second half of \$S_x\$. Therefore we can form the complement of \$S_x\$ and count the ones in its second half:
ḤR&gt;)FŒHṪS - Link: integer, n
   )      - for each (i in [1..n]): e.g. i=3
Ḥ         -   double                       6
 R        -   range                        [1,2,3,4,5,6]
  &gt;       -   greater than i?              [0,0,0,1,1,1]
    F     - flatten -&gt; [0,1,0,0,1,1,0,0,0,1,1,1,...]
     ŒH   - split into two equal length parts
       Ṫ  - tail
        S - sum