  Let $m$ be a positive integer and $b_{m}(n)$ be the number of partitions of
$n$ with parts being powers of 2, where each part can take $m$ colors. We show
that if $m=2^{k}-1$, then there exists the natural density of integers $n$ such
that $b_{m}(n)$ can not be represented as a sum of three squares and it is
equal to $1/12$ for $k=1, 2$ and $1/6$ for $k\geq 3$. In particular, for $m=1$
the equation $b_{1}(n)=x^2+y^2+z^2$ has a solution in integers if and only if
$n$ is not of the form $2^{2k+2}(8s+2t_{s}+3)+i$ for $i=0, 1$ and $k, s$ are
non-negative integers, and where $t_{n}$ is the $n$th term in the
Prouhet-Thue-Morse sequence. A similar characterization is obtained for the
solutions in $n$ of the equation $b_{2^k-1}(n)=x^2+y^2+z^2$.
