Find my two numbers:
- Both are positive integers.
- Their difference is a prime.
- Their product is a perfect square.
- Their sum's last digit is 3.
Bonus: Can you show how many solutions exist?
Puzzling Stack Exchange is a question and answer site for those who create, solve, and study puzzles. It only takes a minute to sign up.
Sign up to join this community4 and 9
Proving uniqueness:
Any mutual prime factor of the numbers is a prime factor of their difference, which is a prime. So, their GCD is either 1 or that prime $p$. So, in order for their product to be a perfect square, they must have the form $(x^2,y^2)$ or $(p x^2,p y^2)$, with $x$ and $y$ relatively prime. Then, their prime difference is $(y+x)(y-x)$ or $p(y+x)(y-x)$. The second case cannot be prime because $y+x \geq 2 $ and $p$ are nontrivial factors, whereas the first case must have $y-x=1$ (assuming WLOG $y \geq x$).
So, we need only consider pairs of the form $(x^2,(x+1)^2)$. We know their sum ends in a $3$ and so is $3$ mod $5$. This is only true for $x=2$ mod $5$. But, then, the prime difference $2x+1$ is a multiple of $5$, which implies that it must be $5$. This gives $x=2$, so $(4,9)$ is the unique solution.