Solving $2^k +k \equiv 0 \pmod {323}$

elementary-number-theory

Find all $k$ such that
$$2^k + k \equiv 0 \pmod{323}.$$


I noticed that $323 = 17\cdot 19$ so I thought about using the Chinese Remainder theorem by considering $2^k+k$ modulo 17 and 19. I got $k \equiv 16 \pmod{17}$ and $k\equiv 18 \pmod{19}$, which gives $k\equiv 322 \pmod{323}$. However, after trying this, the given solution was not valid : $2^{322} + 322 \equiv 156 \not \equiv 0 \mod{323}$.

Can someone explain why this didn't work, and what I can do to solve this problem? Thanks.

Best Answer

As explained in the comments, it didn't work because CRT wasn't applied correctly.

In particular, the solution to $ 2^k + k \equiv 0 \pmod{17}$ has a cycle length of $ 16 \times 17$, because $2^k$ has a cycle length of 16 and $k$ has a cycle length of 17.

So, the (theoretical) approach is to find all the solutions to $2^k+k \equiv 0 \pmod{17} $ working in $\pmod{17 \times 16}$, and likewise for the other equation working in $\pmod{19 \times 18}$, and finally combine them via CRT in $ \pmod{17 \times 19 \times 144}$.

If you understand the above logic, I do not recommend actually finding all the solutions, as it's just a very tedious process that's best left to the computer.