Problem:
A natural number $n$ is called nice if the following properties hold:
• The expression is made up of 4 decimal digits;
• the first and third digits of $n$ are equal;
• the second and fourth digits of $n$ are equal;
• the product of the digits of $n$ divides $n^2$ .
Determine all nice numbers.
Attempt to a solution:
Let $a,b\in \mathbb{N}$, and $0<a\leq9$, $0\leq b\leq9$; then clearly $n=10^3a+10^2b+10a+b=10a(10^2+1)+b(10^2+1)=101(10a+b)$.
Now, if the product of the digits of $n$, which is $a^2b^2$, divides $n^2$, then $ab$ divides $n$. Therefore, there exists a positive integer $m$ such that $(ab)\cdot m=101(10a+b)$.
Case 1: $a=b$
Then $a^2m=1111a$, dividing by $a$ we obtain $am=1111$, and then $a=\frac{1111}{m}$. Being $a$ a positive integer, $m$ must be a positive divisor of $1111$; surely $m\neq 1$, $m\neq 11$ and $m\neq 101$, or $a$ would be greater than $9$. The only possibility is $m=1111$. Therefore $a=b=1$, and, in fact, $\frac{1111^2}{1}=1111^2$
Case 2: $a\neq b$
Then $a=\frac{101b}{bm-1010}$.
We have four possibilities:
1) $bm-1010=101b$, $(m-101)b=1010$, $b=\frac{1010}{m-101}$. Then either $m-101=101\cdot 2$ or $m-101=101 \cdot 5$, otherwise $b$ would be larger then $9$. Hence we obtain that in the first case $b=5$ (and $a=1$ by substituting in the equation above), in the second $b=2$ and $a=1$. Both $1515$ and $1212$ respect the condition to be special.
2) $bm-1010=101$, from which follows that $a=b$, but we've already treated this case and showed that $a=b \rightarrow a=b=1$
3) $bm-1010=b$, from which $a=101$, which would violate the condition that $a<10$
4) $bm-1010$ divides $101$ times one of the factors of $b$, if this number isn't prime. If this is the case, then $b$ can be either $4, 6, 8$ or $9$. The factors of these numbers are $2, 3$ and $4$, consequently we have three possibilities:
- $bm-1010=101\cdot 2$, $b=\frac{1212}{m}=\frac{3\cdot 2^2 \cdot 101}{m}$. The possibilities are $m=101\cdot 3$, $m=101 \cdot 4$, $m=101\cdot 6$ and $m=101 \cdot 2$. In the first case $b=4$ and $a=2$, in the second $b=3$, which we do not accept since it is prime, the same goes for the third case; in the fourth one, $b=6$ and $a=3$.
- $bm-1010=101\cdot 3$, $b=\frac{1313}{m}=\frac{13\cdot 101}{m}$, but neither $m=13$ nor $m=101$ can be accepted because then $b$ would be greater than $9$.
- $bm-1010=101 \cdot 4$, $b=\frac{1414}{m}=\frac{7\cdot 2 \cdot 101}{m}$. Again no value of $m$ can be accepted because $b$ would be a prime number in both cases.
In conclusion, the special numbers are $1111$, $1212$, $1515$, $2424$ and $3636$.
I'm pretty sure the solution is correct, but I'd like to receive some (constructive) criticism about my writing. I just feel like I haven't justified each step properly.