If $(a^{n}+n ) \mid (b^{n}+n)$ for all $n$, then $ a=b$

Hint$\;$ from my $ $ sci.math post $ $ 2006/4/4 $ $ here or here (see there for much motivation)

$$\rm\quad\begin{eqnarray} p-1 \!\!\! &&\mid\rm \color{#c00}{n-1} \\ \rm p\!\!\! &&\mid\rm \color{#0a0}{a+n} && \\ \end{eqnarray}\! \Rightarrow\,\ p\mid \overbrace{a^{\large \color{#c00}n^{\phantom{I}}}\!\!\!-\!a+\color{#0a0}{a\!+\!n}}^{\Large a^n+n}\mid \overbrace{b^{\large \color{#c00}n^{\phantom{I}}}\!\!\!-\!b+\color{blue}{b\!-\!a}+\color{#0a0}{a\!+\!n}}^{\Large b^n +n} \ \,\Rightarrow\,\ p\mid \color{blue}{b-a}\qquad\qquad\quad $$


Claim if our hypothesis holds, $a \equiv b \ (\text{mod}\ p)$ for any prime $p$.

Proof:

Find $n$ so that $n \equiv -a \ (\text{mod}\ p)$ and $n \equiv 1 (\text{mod}\ p-1)$ ( we can do this by Chinese Remainder Theorem). Then

$$a^{n} + n \equiv a^1 + n = a - a = 0 (\text{mod} \ p)$$

Therefore since $a^n + n \mid b^n + n$, $b^n + n \equiv 0 (\text{mod}\ p)$

But

$$b^n + n \equiv b^1 + n \equiv b - a (\text{mod}\ p)$$

therefore $b \equiv a \pmod p$.

Our result now follows by picking any $p > b$.

NOTE by BD $\;$ This solution has been posted before in at least a few well-known math forums, e.g. see my sci.math post on April 4,2006, and see Rust's post on AoPS, July 19, 2009. It also appeared in at least one other forum much more recently (alas, I can't recall which one). Almost surely, by now the problem and solution is listed in various problem collections, so it should be considered somewhat well-known.