0

If I square 37 I get 1369. Excluding any solution having 37 as the last digits, can I find other numbers when squared to give me 1369 as their last digits? Solutions are any numbers having last four digits 1213, 3787, 6213, and 8787. Do all primes have such solutions and NOT having p itself as the last digits?

  • Why did you not mention $9963$? – Hagen von Eitzen Jun 28 '19 at 18:06
  • 2
    Not sure what primes have to do with it. We note that $(-n)^2\equiv n ^2\pmod {10^4}$, (sticking with $4$ digits), so $10000-37=9963$ would certainly work. Otherwise, reduce your square $\pmod {2^4}$ and $\pmod {5^4}$, extract all possible square roots, and use the CRT to lift them to solutions $\pmod {10^4}$. – lulu Jun 28 '19 at 18:13
  • 1
    I missed 9963 because I stopped (for some dumb reason) at 363 squared. I used primes just to see if other primes could be solutions. For simple 23 squared and excluding 23 as last digits, there are four prime : 227, 523, 727, and 773. – J. M. Bergot Jun 28 '19 at 18:48
  • you also missed $\color{red}4963$ and $5037$ – J. W. Tanner Jul 08 '19 at 17:51

2 Answers2

2

EDITED: For any $n\ge 1$ and any $y$ coprime to $10$, $x^2 \equiv y^2 \mod 10^n$ iff $x \equiv \pm y \mod 2^{n-1}$ and $x \equiv \pm y \mod 5^n$. Thus if $n \ge 3$, there are $8$ solutions to the equation $x^2\equiv y^2 \mod 10^n$. In the case $y=37$, $n=4$, these are:

$$\matrix{x \equiv 37 \mod 2^3, & x \equiv 37 \mod 5^4 & \implies x \equiv 37 \ \text{or}\ 5037 \mod 10^4\cr x \equiv 37 \mod 2^3, & x \equiv -37 \mod 5^4 & \implies x \equiv 6213 \ \text{or}\ 1213 \mod 10^4\cr x \equiv -37 \mod 2^3, & x \equiv 37 \mod 5^4 & \implies x \equiv 3787 \ \text{or}\ 8787 \mod 10^4\cr x \equiv -37 \mod 2^3, & x \equiv -37 \mod 5^4 & \implies x \equiv 9963 \ \text{or}\ 4963 \mod 10^4\cr }$$

Robert Israel
  • 448,999
  • Remove the obvious 37 and 5037, then for a square of any length there will just be six solutions...as I understand it. A true novelty would be for all six to be primes for some original prime squared. I solved it by simply trial and error using a humble calculator and placing 1 to 5 in front of partial solution and then squaring to get proper digits for the number squared. – J. M. Bergot Jun 28 '19 at 19:18
  • Since you mention in your second sentence about $y$ being coprime to $10$, I assume you meant to start your first sentence with something like "For any $n \ge 1$ and any $y$ coprime to $10$, ..." as the rest of that sentence will then be correct. Otherwise, for example, $n = 4, x = 500, y = 1000$ is a counter-example to $x \equiv \pm y \pmod{2^{n-1}}$.. – John Omielan Jun 29 '19 at 01:51
  • 1
    @JohnOmielan Good point, will edit. – Robert Israel Jun 30 '19 at 03:31
  • 1
    There are $13$ values $v$ such that there are $5$ primes $p < 10^4$ with $p^2 \equiv v \mod 10^4$. For example, $1543, 2207, 3457, 7207, 7793$ all have $p^2 \equiv 849$. There are none with $6$ primes. Of course if you don't limit yourself to primes $< 10^4$, there infinitely many primes for any $v$ that is a quadratic residue mod $10^4$. – Robert Israel Jun 30 '19 at 03:41
  • 1
    On the other hand, there are $4$ values $v$ such that there are $6$ primes $p < 10^5$ with $p^2 \equiv v \mod 10^5$: $16881, 42089, 62121, 94481$. For example, $33641, 47609, 52391, 66359, 83641, 97609$ all have $p^2 \equiv 16881$. – Robert Israel Jun 30 '19 at 03:44
  • Take 1213 and add an infinite number of terms in front of it: 11213^2 will give you 125731369; the same is true for the other four-digit solutions. – J. M. Bergot Jul 02 '19 at 18:30
0

It $$p\equiv 0,1,3,5,7,9\mod 10$$ then $$p^2\equiv 0,1,5,9\mod 10$$