I am not a mathematician, but I gather from this paper that any string of digits ending in '1', '3', '7', or '9', no matter what it is, is the ending sequence of the decimal representation of infinitely many cubes. This other paper extends this result to other exponents that are relatively prime to 10. Each paper holds out the case of squares for further study.

My question is: does this hold for squares? Is it the case that there is some string of digits, S, such that every string ending in S is itself the ending of infinitely many squares? If so, does this result hold for every other exponent too, so that fourth powers, fifth powers etc. will also have some string, S, such that every string ending in S is itself the ending of infinitely many fourth powers (or fifth powers, etc. as the case may be)?

(I am told that this German paper should answer my question, but, alas, I don't read German.)

I am not a mathematician, so I am afraid that any answers will have to be spelt out very clearly for me.

Thanks very much for any help that anyone can give -- much appreciated.


1 Answer 1


The answer to your question is yes, there do exist strings $S$ for which, given any string $T$ that finishes with $S$, there exist infinitely many square numbers whose final digits are the string $T$.

(S = 001 is such a sequence, and in fact we will show below how to construct 49 other suitable sequences, all of length 3.)

The proof can be given in a single paragraph, but this will require me to use certain mathematical notions (from group theory) that I suspect will not be familiar to you as a non-mathematician.

We know from the Chinese remainder theorem that the group of units $(\mathbb{Z}/10^k \mathbb{Z})^{\times} \cong (\mathbb{Z}/2^k \mathbb{Z})^{\times} \times (\mathbb{Z}/5^k \mathbb{Z})^{\times}$. For all $k \geqslant 1$ we have $(\mathbb{Z}/5^k \mathbb{Z})^{\times} \cong C_{\varphi(5^k)} \cong C_{4 \cdot 5^{k-1}}$ by the theory of primitive roots. Similarly, for all $k \geqslant 3$, we have $(\mathbb{Z}/2^k \mathbb{Z})^{\times} \cong C_2 \times C_{2^{k-2}}$. Putting this all together we have $$(\mathbb{Z}/10^k \mathbb{Z})^{\times} \cong C_2 \times C_{2^{k-2}} \times C_{4 \cdot 5^{k-1}}$$ and so there are $\frac{1}{8}\vert (\mathbb{Z}/10^k \mathbb{Z})^{\times}\vert = 2^{k-2} \cdot 5^{k-1}$ squares modulo $10^{k}$ that are comprime to $10$. This increases by a factor $10$ when $k$ goes to $k+1$, so it follows that all possible extensions of the squares in $(\mathbb{Z}/10^k \mathbb{Z})^{\times}$ must be squares in $(\mathbb{Z}/10^{k+1} \mathbb{Z})^{\times}$. Taking $S$ to be the set of quadratic residues modulo $10^3$ that are comprime to $10$ (chosen to lie between $1$ and $999$), we see that all strings in $S$ are suitable.

In thinking about how I would explain this argument in non-technical terms, I've realised that it would be almost impossible to do without knowing more details about your particular mathematical background. Do get in touch if you need to discuss this proof further!

  • $\begingroup$ Thank you ever so much, Aled, for such a detailed and helpful answer. I am very grateful. $\endgroup$ Mar 4, 2021 at 17:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .