Infinitely many $n$ such that $2^n-n$ is divisible by a prime

number theory

I found the following question and can't make much headway with it.

Show that there exist infinitely many positive integers $n$ such that $2^n \equiv n \mod p$ where $p$ is a odd prime…

I started by writing the number as $n=(p-1)k+c$ which implies $$2^c \equiv c-k \mod p$$ where I used Fermat's Little theorem.
Now if $k$ is of the form $pm$ for some integer $m$ we get $n=(p-1)(p)m+c$
$$2^c \equiv c \mod p$$ and we have reduced $n$ to some smaller integer $c$ but I can't figure out how to find the smallest number $c$ which would then generate infinitely many $n$.

Any help in finding a possible approach to this would be highly appreciated.

Best Answer

Consider the two sequences $a_n$ and $b_n$ of integers modulo $p$ given by $$ \begin{array}{c|cccc} n&1&2&3&\cdots\\\hline a_n&2^1& 2^2& 2^3& \cdots\\ b_n &1& 2& 3&\cdots \end{array} $$ One has (not necessarily fundamental) period $p-1$ by Fermat's little, the other has (fundamental) period $p$, which means that their periods will line up every possible way, infinitely many times in the above table. Add that to the fact that there are numbers which appear in both sequences, and that's a full solution to your problem.

Related Question