Least positive integer $n$ such that the digit string of $2^n$ ends on the digit string of $n$

289 Views Asked by At

What is the least positive integer $n$ such that the digit string of $2^n$ ends on the digit string of $n$:
$$ (2^n)_{10} = d_m \, d_{m-1} \cdots d_{q+1} \, (n)_{10} \\ (n)_{10} = d'_{q} \cdots d_1' \\ d_i, d'_j \in \{0, \ldots, 9 \} $$

As in $2^3$ would somehow end in 3, or $2^5$ would end in 5.

Frankly I don't even know where to start. Thanks in advance.

4

There are 4 best solutions below

0
On BEST ANSWER

Here is a less brute-force method:

In order for the digit string of $2^n$ to end with the digit string of $n$, it is necessary (but not sufficient) that $2^n$ and $n$ have the same last digit, i.e. $2^n \equiv n \pmod{10}$.

It is easy to check that $\begin{cases}2^n \equiv 2\pmod{10} & \text{if} \ n\equiv 1 \pmod{4} \\ 2^n \equiv 4\pmod{10} & \text{if} \ n\equiv 2 \pmod{4} \\ 2^n \equiv 8\pmod{10} & \text{if} \ n\equiv 3 \pmod{4} \\ 2^n \equiv 6\pmod{10} & \text{if} \ n\equiv 0 \pmod{4}\end{cases}$.

Since $2^n$ is even, $n$ must also be even. So we have the following 2 possibilities:

$n \equiv 2\pmod{4}$ AND $n \equiv 2^n \equiv 4\pmod{10}$, i.e. $n \equiv 14 \pmod{20}$

$n \equiv 0\pmod{4}$ AND $n \equiv 2^n \equiv 6\pmod{10}$, i.e. $n \equiv 16 \pmod{20}$.

So we only need to check $n \equiv 14 \ \text{or} \ 16 \pmod{20}$.

Since $2^{14} = 16384$, $2^{16} = 65536$, $2^{34} = 17179869184$, and $2^{36} = 68719476736$, the smallest positive integer $n$ such that the digit string of $2^n$ ends with the digit string of $n$ is $n = 36$.

8
On

I just started checking numbers in a calculator.

The first $n$ I got such that $2^{n} = \dots n$ is $n = 36$. We have $2^{36} = 68,719,476,736$.

0
On

I checked up to $n = 3 \cdot 10^5$ and the only solutions are $36, 736, 8736, 48736$. It also turns out that $948736$, $2948736$, $32948736$ are solutions, each of which I found by prepending $1 \dots 9$ to the previous solution. It seems a plausible conjecture that the solutions are the suffixes of some leftward-infinite decimal sequence, i.e. $n$ is a solution if and only if $n = \text{reverse}(\lfloor 10^k \cdot r \rfloor)$ where $k \ge 2$ and $r \approx 0.63784923$.

EDIT: Jesse P Francis and Robert Israel found the OEIS sequence and the terms listed there are consistent with that conjecture. There is a link to another sequence with a simple recursive formula which is the same except it contains duplicates, apparently at the same positions where $0$ occurs in the digits of $r$ defined above. The digits of $r$ are given by this sequence.

0
On

This OEIS sequence is just what you are looking for: https://oeis.org/A064541. Least number is 36.