# Alphametic puzzle, involving square and prime numbers [closed]

I have been trying puzzle solving recently and came across this problem.

Any hints on how to do this?

So far, I have found that N, R and F must be odd (as they are the last digit in a 5 digit prime number), and that N must be specifically either 1,5 or 9, because all square numbers end in either 1,4,9,5 or 6, and N can’t be 4 or 6, because it must be odd. Finally, I think E must be even because N-E=R, and since N and R are odd, E must be even.

However, these observations don’t seem to be getting me anywhere.

• N must be specifically either 1,5 or 9. N can't be 5 because SEVEN is prime. Aug 23, 2019 at 15:54
• it seems like that this puzzle comes from elsewhere. please provide the source. Aug 23, 2019 at 16:19

Is it

$$FOUR=3407$$, $$TEN=529$$?

Reason:

Since $$SEVEN$$ is a prime, $$N$$ must be in $$\{1,3,7,9\}$$. Since $$TEN$$ is a square, $$TEN \in \{169, 289, 361, 529, 729, 861\}$$.
Since $$FOUR$$ is a prime, $$R$$ must be in $$\{1,3,7,9\}$$. Since $$E+R\equiv N\pmod {10}$$, we can rule out $$TEN=361$$ and $$TEN=861$$ (as $$R=5$$ in these cases).
Since $$SEVEN=THREE+FOUR$$, $$S=T+1$$.
If $$TEN=729$$ then $$SEVEN=82V29$$ and $$R=N-E=7=T$$. Rule out this.
If $$TEN=289$$ then $$S=3$$ and $$R=N-E=1$$. $$SEVEN=THREE+FOUR$$ translates to $$38V89=2H188+FOU1$$. Looking at the thousand digit, we have $$H+F=17$$ or $$18$$. But $$9$$ is already used by $$N$$. Rule out this.
If $$TEN=169$$ then $$S=2$$ and $$R=N-E=3$$. $$SEVEN=THREE+FOUR$$ translates to $$26V69=1H366+FOU3$$.

• Looking at the thousand digit, we have $$H+F=15$$ or $$16$$. Since $$9$$ is already used by $$N$$, it must be that one of $$H,F$$ is $$8$$ and the other one is $$7$$. Since $$RUOF$$ is a prime, $$H=8$$ and $$F=7$$.
• Since $$6=6+U$$, $$U=0$$.
• The rest digits are $$4,5$$, one of which is $$O$$ and the other is $$V$$. However $$V=3+O$$ which is impossible.
So $$TEN=169$$ is ruled out. We only have $$TEN=529$$ now. $$S=2$$ and $$R=N-E=7$$.
• $$SEVEN=THREE+FOUR$$ translates to $$62V29=5H722+FOU7$$.
• Since $$2=2+U$$, $$U=0$$. We have $$V,H,F,O$$ being digits $$1,3,4,8$$.
• Since $$RUOF$$ is a prime, $$F=1$$ or $$F=3$$. But if $$F=1$$ then the ten thousand digit wouldn't carry. So $$F=3$$. We also have $$H=8$$.
• Then $$V\equiv 7+O\pmod{10}$$, so $$V=1$$ and $$O=4$$. We have $$FOUR=3407$$.

• Yes, your method is correct. I also asked this question on the Math Stack Exchange here:math.stackexchange.com/questions/3332044/… Aug 23, 2019 at 16:59
• Dangit, I was almost there and then saw your answer pop up. Well done! Aug 23, 2019 at 17:09