Let $b$ be an integer greater than 2, and let $N_b = 1_b + 2_b + \cdots + 100_b$ (the sum contains all valid base $b$ numbers up to $100_b$). Compute the number of values of $b$ for which the sum of the squares of the base $b$ digits of $N_b$ is at most 512.
That was the question. I need a hint on how to progress further into the problem without using trial, error and brute force to compute each step. Thanks :)
First note that $(100)_b=b^2$, so
$$N_b=\sum_{k=1}^{b^2}k=\frac12b^2(b^2+1)=\frac12b^4+\frac12b^2\;.\tag{1}$$
It’s convenient now to consider two cases, $b$ even and $b$ odd.
Suppose that $b$ is even, say $b=2a$; then $N_b=ab^3+ab=(a0a0)_b$, so the sum of the squares of the base $b$ digits of $N_b$ is $2a^2$, and it’s easy to count the values of $a$ for which $2a^2\le 512$.
Now suppose that $b=2a+1$; it’s just a little trickier, but you can still use $(1)$ to work out the base $b$ representation of $N_b$.