-1

The problem is to find the smallest natural number $n$ so that its square's last $5$ digits are $00001$. $n$ and $n^{2}$ cannot begin with $0$.

I know that we have a lower bound on $n$, namely $\sqrt{100001}≈316.23$. Intuitively, I think the smallest natural number with the property has to be $100001$ and I have not found any counterexamples to this (in fact I checked using some code and it seems to be correct). I haven't been successful in proving this rigorously however. Do I use the lower bound in some way? How to approach this type of questions in general, i.e. how do digits respond to squaring/cubing?

All help is appreciated.

Miyes
  • 151
  • You seek to solve $,x^2\equiv 1\pmod{10^5),,$ and the linked dupes expl;ain how to do so generally via CRT. – Bill Dubuque Mar 28 '21 at 09:48
  • @Bill the CRT reduces the problem here to one mod $5^5$. That doesn't seem to be as trivial as the reduction to mod $x<18$? – Bananach Mar 28 '21 at 14:11
  • @Bananach Generally it's simple and quick to lift roots $!\bmod p,$ to roots $!\bmod p^k,$ by Newton's method (Hensel's Lemma). – Bill Dubuque Mar 28 '21 at 14:29
  • 1
    Simple by your standards, but probably not by the OP's. Just because two questions are equivalent to the professional mathematician doesn't mean they are duplicates for the purposes of math.stackexchange.com. Also, this answer being about a simple concrete polynomial modulo equation means there are simpler ways to answer it than involving the CRT, as the other answers show, which would have been missed if this question was treated as a mere duplicate – Bananach Mar 28 '21 at 14:40

3 Answers3

5

You want to find $n$ such that $n^2 \equiv 1 \pmod {10^5}$.

By Chinese remainder theorem, this is equivalent to $n^2 \equiv 1 \pmod {2^5}$ and $n^2 \equiv 1 \pmod {5^5}$.

We have $$n^2 \equiv 1\pmod {2^5} \iff n \equiv \pm 1 \pmod {2^4}$$ and $$n^2 \equiv 1 \pmod {5^5} \iff n \equiv \pm 1\pmod {5^5}.$$ Again by Chinese remainder theorem, these congruence relations give four possibilities of $n \mod 5\cdot 10^4$, namely $$n\equiv 1, 18751, 31249, 49999 \pmod {50000}.$$ From here, we see that the smallest such $n$ is $18751$.

Thomas Andrews
  • 186,215
WhatsUp
  • 22,614
  • One quick way to avoid doing Chinese remainder theorem four times is that $1,49999$ will obviously give answers that are wrong. Solve one of the other two cases, and if the result is greater than $25000$ subtract it from $50000$ to get the smaller one. – Thomas Andrews Mar 27 '21 at 21:15
  • Is there a reason other than trying it out to justify going from $2^5$ to$2^4$ but staying at $5^5$? – Bananach Mar 28 '21 at 10:27
  • @Bananach The short answer is that we "square" here, which is raising to power $2$. More precisely, we have $p$-adic logarithm/exponential maps, which give isomorphism between $1 + 2^r \Bbb Z_p$ and $2^r \Bbb Z_p$ for $r \geq 2$. Squaring corresponds to multiplying by $2$, thus increases the value of $r$ by $1$. – WhatsUp Mar 28 '21 at 11:37
  • @Bananach A more elementary way is to write $(1 + 2^rx)^2 = 1 + 2^{r + 1}x + 2^{2r+2}x^2$ and see directly that the power of $2$ appearing in $(1 + 2^rx)^2 - 1$ is $2^{r + 1}$. – WhatsUp Mar 28 '21 at 11:38
  • I think the exponent should be $2^{2r}$ instead of $2^{2r+2}$, but otherwise I'm happy with the answer. "Yes, there is a deeper reason, but also yes, you can just insert it and see the extra factor of 2 appear from the binomial theorem" – Bananach Mar 28 '21 at 11:58
  • @Bananach You are right, that was an error. Unfortunately I cannot edit that comment any more... – WhatsUp Mar 28 '21 at 12:07
  • Hm, I just realized that $n^2\equiv 1 (\text{mod } 5^5)\Rightarrow n\equiv \pm 1 (\text{mod } 5^5)$ is still unclear to me – Bananach Mar 28 '21 at 12:11
  • It may have an elementary proof as well (though I doubt as short as the opposite implication for base 2) but I feel your answer would be more complete if it highlighted the nontriviality (by standards of the question's difficulty level) of these two equivalences of square roots modulo powers of even/odd primes – Bananach Mar 28 '21 at 12:14
  • @Bananach The easiest way to see this is to use the fact that $\left(\Bbb Z/5^5 \Bbb Z\right)^\times$ is cyclic. In classical languages, this means that there is a primitive root mod $5^5$. This implies that the equation $n^2 \equiv 1 \pmod 5^5$ has exactly $2$ solutions, which are obviously $\pm 1$. – WhatsUp Mar 29 '21 at 16:36
3

Just to give a somewhat different approach, we have $10^5\mid(n-1)(n+1)$, so in particular $5^5=3125$ divides either $n-1$ or $n+1$, since two numbers that differ by $2$ cannot both be divisible by $5$. We may as well assume it divides $n-1$ (and then look for the smallest value of $|n|$). Since $n$ is obviously odd, we must have $n=6250m+1=32\cdot195m+10m+1$ for some $m$. Now, since $\gcd(n-1,n+1)=2$, we must have either $16\mid10m$ or $16\mid10m+2$. The smallest (nonzero) value of $m$ that satisfies one of these is $m=3$ (for which $16\mid10m+2$). So $n=6250\cdot3+1=18751$ is the smallest value of $n$ (greater than $1$) for which $n^2$ ends in $00001$.

Barry Cipra
  • 81,321
1

We first have to realize that since n^2 must end in 00001, the units digit of n is either 1 or 9 because 1^2 = 1 and 9^2 = 81 (ends in 1). Then, to find a number n such that n^2 is ending in 001, the only last 2 possible digits of n can be 51, 49, or, 99. We can then repeat the process for 0001, ..., uptil 00001 to find that the smallest value of n is 18751.