Find all positive integers $n$ such that $6^n+1$ it has all the same digits when it is writen in decimal representation.
Problem
Source: Kosovo MO 2019 Grade 11, Problem 2
Tags: number theory
10.03.2019 15:08
$6^n + 1\equiv 7\mod 10$, meaning that all digits must be equal to $7$. $n=1$ is a trivial solution. We have $6^n + 1 = 7\cdot\frac{10^k-1}{9}$ for some $k>1$. Doing some algebra yields $$16\cdot(3^{n+2}\cdot 2^{n-4} + 1) = 7\cdot 2^k\cdot 5^k $$ We proceed to check cases $n=2, 3, 4$ manually (they do not produce valid solutions) and notice that for $n>4$, $LHS$ always has a factor of $16$ and no higher power of $2$. $RHS$ must have the same property, hence $k=4$ which yields $n=5$ as the only other solution.
27.12.2020 12:51
The only positive integers that work are $n = 1,5$, and it is not hard to see that they both work. Then we proceed to prove that they are the only ones. Note that the unit digit of any number of the form $6^n+1$ is 7, thus all the digits of the number are 7. Then since we know that $n = 5$ is a solution and we can check that $n = 2, 3, 4$ are not solutions, we assume for the sake of contradiction that there exists some $k > 5$ such that $6^k+1$ contain only the digit 7. Then since $6^k+1>6^5+1$, we have that $$\underbrace{7\cdots 7}_{\text{some number of 7s}} \cdot 10^4 \equiv 0\mod{6^5}$$by subtraction. However note that $2^5\mid 6^5$ but $2^5 \nmid 7\cdots 7\cdot 10^4$, we have a contradiction and we are done.