Find all positive integers $n$ such that the decimal representation of $n^2$ consists of odd digits only.
Problem
Source: Baltic Way 2010
Tags: modular arithmetic, number theory proposed, number theory
19.11.2010 21:58
WakeUp wrote: Find all positive integers $n$ such that the decimal representation of $n^2$ consists of odd digits only. If the number $n$ has just one digit, we get $1$ and $3$ If the number $n$ has at least two digits, ending in $\overline {ab}$, $b$ must be odd : $b=1$ implies second digit from the right in $n^2$ is $2a\pmod {10}$ even $b=3$ implies second digit from the right in $n^2$ is $6a\pmod {10}$ even $b=5$ implies second digit from the right in $n^2$ is $2\pmod {10}$ even $b=7$ implies second digit from the right in $n^2$ is $4a+4\pmod {10}$ even $b=9$ implies second digit from the right in $n^2$ is $8a+8\pmod {10}$ even Hence the answer : $\boxed{n\in\{1,3\}}$
19.11.2010 22:02
If $n=\sum_k a_k10^k, n^2=\sum_k b_k10^k$. $a0=1, a_0^2=01$ $a_0=3, a_0^2=09$ $a_0=5, a_0^2=25$ $a_0=7,a_0^2=49$ $a_0=9, a_0^2=81$. For all cases $b_1$ is even. Therefore $n^2<10$ and $n=1$ or $n=3$.
17.08.2020 01:04
$n^2 \in \{01, 05, 09, 00, 04, 16\}$ $(mod$ $20)$
If $n^2=\sum_k x_k10^k$ and $n^2 \geq 10\implies x_0$ is even or $x_1$ is even. If $n^2 < 10$, when $n \leq 3$. Answer: $n \in \{1, 3\}$.
15.08.2021 15:25
It is clear that $n$ needs to be odd. Now notice that the square of an odd number ends in $1,5$ or $9$, all of them being of the form $4k+1$. If $n^2$ contains at leats two digits, then the second last digit needs to be even, otherwise the number formed by the last two digits is of the form $m=10*a+b$, where $a$ is odd and $b\in\{1,5,9\}$ and therefore $m\equiv 3(\text{mod} \ 4)$, which in turn means that $n^2\equiv 3(\text{mod} \ 4)$, a contradiction. Therefore $n$ should be either $1$ or $3$ to satisfy the condition of the problem .