If one is given a set of digits, such as 3352, is there a simple way of finding the square numbers closest to 0 that would begin with the given digits?
Square Number Problem
89 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
Yes! Suppose $n$ is a natural number with $$n^2 = \underbrace{3352\ldots}_{x \text{ digits}}$$ Then $$0.3352 \times 10^x \le n^2 < 0.3353 \times 10^x$$ or $$3352 \times 10^{x-4} \le n^2 < 3353 \times 10^{x-4}.$$ If $x$ is even, put $x = 2k$ for a natural number $k$ and we'll see $$3352 \times 10^{2k- 4} \le n^2 < 3353 \times 10^{2k-4}$$ so $$\sqrt{3352} \times 10^{k-2} \le n < \sqrt{3353} \times 10^{k-2}$$ or $$57.896\ldots \times 10^{k-2} \le n <57.905\ldots \times 10^{k-2}.$$ If you want the smallest $n$, you want to take $k$ as small as possible. If you take $k = 2$, there will be no natural numbers $n$ which satisfy the inequality, so you need to take $k = 3$ in which case $n = 579$ works.
If $x$ is odd, then $x = 2k+1$ for some $k \in \mathbb N$ and we have $$3352 \times 10^{2k-3} \le n^2 < 3353 \times 10^{2k-3}$$ or $$33520 \times 10^{2k-2} \le n^2 < 33530 \times 10^{2k-2}$$ so $$183.084\ldots \times 10^{k-1} \le n < 183.111\ldots \times 10^{k-1}.$$ Again, taking $k$ as small as possible, we will find $k=1$ doesn't work, but $k=2$ yields a solution $n = 1831$.
Thus the smallest $n$ such that $n^2$ begins with $3352$ is $n = 579$.
We have $$\sqrt{3352}=57.89645930452\ldots$$ so that our first guesses would be $58^2$, $579^2$, $5790^2$, $57897^2$, $578965^2$ and so on as smallest squares above $3352$, $335200$, $33520000$, etc. Note that we simply cut off the expansion of the square root and rounded the last digit up to arrive at this sequence. This left out half the allowed powers of ten, so we also look at $$\sqrt{10\cdot 3352}= 183.084679861\ldots$$ and thus interlace the sequence above with $184^2$, $1831^2$, $18309^2$, etc. The first to give the correct leading digis will be our result.
In fact, we need not need to make so many tries if we compute $$\sqrt{3353+1}=57.9050947672\ldots $$ and $$\sqrt{10\cdot 2253+1}= 183.0874108\ldots$$ as well: The latter agrees with $\sqrt{10\cdot 3352}$ for the first two decimals, hence that branch need not be checked until we want to try the third decimal. On the other hand, alreday the first decimal of $57.9\ldots$ exceed that of $57.8\ldots$, so that we know that already working with the first decimal will help us. Thus $579^2=335241$ is the smallest perfect square starting with digits $3352$.