# Can this be continued forever?

We have:

$$1=1^2$$ and $$25=5^2=3^2+4^2$$

and $$441=21^2=20^2+4^2+5^2$$

So, for $k=1,2,3$ we have a $k$-digit number that is a perfect square and a sum of $k$ different non-zero perfect squares.

I did not seek further but this observation led me to conjecture:

For every $k \in \mathbb N$ there exists a $k$-digit number that is a perfect square and a sum of exactly $k$ different non-zero perfect squares. Is this known to be true/false?

Thanks for the help.

• It must be true because any integer can be expressed as the sum of four squares (for large $k$ choose some small,ones and you are guaranteed the last four), and there are integer squares with any number of digits you care to choose. You have demonstrated the cases up to three squares. – Mark Bennet Dec 30 '17 at 14:24
• What is special about decimal digits? – user Jan 18 '18 at 16:03

Small values of $k$ are simple to check and every natural number is the sum of four squares by Lagrange's theorem. Asymptotics for the average order of the representation function $$r_k(n)=\left|\{(a_1,\ldots,a_k)\in\mathbb{Z}^k : a_1^2+\ldots+a_k^2 = n\}\right|$$ are well-known thanks to Hardy's earliest works (we are essentially counting the lattice points inside a hypersphere, which is a direct generalization of Gauss circle problem) and the constraint about different squares has a little impact. So yes, it is just a matter of recalling some well-known facts.
One may also use the Rusza-Plunnecke inequality since the set of squares is an additive basis of order $4$; or show that there are infinite rational points on the hypersphere $x_1^2+\ldots+x_k^2 = 1$, which is straightforward through the usual methods of algebraic geometry recalling Vieta jumping.