
FORMULA

Main diagonal of triangle A140047.
a(n) = Sum_{j=0..2^n1, A010060(j)=0 } j^(n1), n>=1; also,
a(n) = Sum_{j=0..2^n1, A010060(j)=1 } j^(n1), n>=1;
where A010060 is the ThueMorse sequence.


EXAMPLE

For n=3, since A010060(j) = 0 at j={0,3,5,6}, then
a(3) = 0^2 + 3^2 + 5^2 + 6^2 = 70 ;
and since A010060(j) = 1 at j={1,2,4,7}, we also have
a(3) = 1^2 + 2^2 + 4^2 + 7^2 = 70.
For n=4, since A010060(j) = 0 at j={0,3,5,6,9,10,12,15}, then
a(4) = 0^3 + 3^3 + 5^3 + 6^3 + 9^3 + 10^3 + 12^3 + 15^3 = 7200 ;
and since A010060(j) = 1 at j={1,2,4,7,8,11,13,14}, we also have
a(4) = 1^3 + 2^3 + 4^3 + 7^3 + 8^3 + 11^3 + 13^3 + 14^3 = 7200.
