# The 4 digit base $6$ number $abcd$ with $a>0$ and $d$ odd is a perfect square.

The 4 digit base $6$ number $abcd$ with $a>0$ and $d$ odd is a perfect square. List all possible values of $c$. (The letters are the digits of the base 6 number.)

I've rewritten $abcd_6$ into $216a + 36b + 6c + d$, and I know that $d$ can be $1,3,5$, but now I'm stuck. I guess I could start plugging in some numbers since $a,b,c,d \le 5$, but I feel like there would be a more efficient way.

• I think plugging in some numbers will work, and reasonably quickly. Test the squares of $1$ through $35$, convert the results to base $6$, and that will solve the problem. Commented Feb 23, 2018 at 14:19
• And you can remove the even numbers, so there are only $18$ cases to write out Commented Feb 23, 2018 at 14:23
• So, you are looking for all odd squares between $6^3=216$ and $6^4-1=1295$.
– robjohn
Commented Feb 23, 2018 at 14:28

The odd perfect squares in the interval $[217,1295]$ where we are interested are $225,289,361,441,529,625,729,841,961,1089,1225$. Reducing these modulo $36$ we get $9,1,1,9,25,13,9,13,25,9,1$. Note these are exactly the odd quadratic residues modulo $36$ but here we have shown that they all crop up in our desired interval. The quotients of these numbers when divided by $6$ gives the possible values of $c$: $0,1,2,4$.

Work modulo $36$, test only the odd numbers $15$ through $35$:

$^\text{(we may omit$1$through$13$, since these would not satisfy$a>0$)}$

$$\,$$

$$(15)^2 \equiv 9 \pmod{36}$$ $$(17)^2 \equiv 1 \pmod{36}$$ $$(19)^2 \equiv 1 \pmod{36}$$ $$(21)^2 \equiv 9 \pmod{36}$$ $$(23)^2 \equiv 25 \pmod{36}$$ $$(25)^2 \equiv 13 \pmod{36}$$ $$(27)^2 \equiv 9 \pmod{36}$$ $$(29)^2 \equiv 13 \pmod{36}$$ $$(31)^2 \equiv 25 \pmod{36}$$ $$(33)^2 \equiv 9 \pmod{36}$$ $$(35)^2 \equiv 1 \pmod{36}$$ $$\,$$

The possible remainders for odd perfect squares, modulo $36$, are $1$, $9$, $13$, and $25$.

In base $6$, these are equivalent to the last two digits being $$01_6,\,13_6,\,21_6,\,41_6$$

In particular, $$\boxed{\,c \, \in \, \left\{0,1,2,4\right\}\,\,}$$

• As robjohn and @pilgrim noted, this can be made a little bit more efficient by omitting calculations for $1$ through $13$, since these numbers have squares that won't satisfy the requirement $a>0$. Commented Feb 23, 2018 at 14:36

To look at the last two digits in base $6$, we want to look at $4k^2+4k+1$ mod $36$. Since $k^2+k$ mod $9$ repeats with period $9$, $4k^2+4k+1$ mod $36$ also repeats with period $9$. Therefore, the the last two digits of odd squares in base $6$ also repeat with period $9$.

Perhaps more concisely, \begin{align} (2(k+9)+1)^2 &=(2k+19)^2\\ &=4k^2+76k+361\\ &=\left(4k^2+4k+1\right)+(72k+360)\\ &=(2k+1)^2+36(2k+10) \end{align} Thus, $(2k+1)^2$ repeats mod $36$ with period $9$. That is, the last two digits of $(2k+1)^2$ in base $6$ repeat with period $9$.

Thus, all the possible values of the $6^1$ digit in base $6$ are given in red: $$\begin{array}{c|c|r} k&(2k+1)^2&\text{base 6}\\ \hline 0&1&\color{#C00}{0}1\\ 1&9&\color{#C00}{1}3\\ 2&25&\color{#C00}{4}1\\ 3&49&1\color{#C00}{2}1\\ 4&81&2\color{#C00}{1}3\\ 5&121&3\color{#C00}{2}1\\ 6&169&4\color{#C00}{4}1\\ 7&225&10\color{#C00}{1}3\\ 8&289&12\color{#C00}{0}1\\ \end{array}$$ These are all the possible values for any odd square in base $6$, in particular from $15^2$ to $35^2$.

• This is more complete than either of the other answers, +1 Commented Feb 23, 2018 at 15:40