In a parlor game, the magician asks one of the participants to think of a three digit number (abc) where a, b, and c represent digits in base 10 in the order indicated. The magician then asks this person to form the numbers $(acb)$, $(bca)$, $(bac)$, $(cab)$, and $(cba)$, to add these five numbers, and to reveal their sum, $N$. If told the value of $N$, the magician can identify the original number, $(abc)$.
This is an excerpt from the 1986 AIME (problem 10), in which $N = 3194$. But can the magician actually guess the number, for any $N$? How?
(I'd prefer an answer that allows for $a = 0$, i.e. replace "three digit number" with any number between $0$ and $999$. But the problem as stated, with $a \ge 1$, is fine too.)
One idea:
We can prove that the original 3-digit number is determined modulo $666$. To see this, if $m = 100a + 10b + c$ is the original number, then $N = 222(a+b+c) - m$. Modulo $222$, this gives us $m \equiv -N$. And modulo $9$, $m \equiv a+b+c$, therefore $N \equiv 222m - m$, and solving we get $m \equiv 2N$. Since $m$ is determined mod $9$ and mod $222$, it is determined mod $\text{lcm}(9,222) = 666$. Specifically, $m \equiv 443N \pmod{666}$.
But this doesn't quite solve the problem, because $666 < 1000$.
With the calculated value of $m\bmod666$ we evaluate possible values of $m=\overline{abc}$. If there is only one possible number ($m>333$) then we are done. Otherwise there will be two candidates $m_1=m$ and $m_2=m+666$ and we can check them easily to see whether they produce $N$ exactly.
$m_1$ and $m_2$ must produce different values of $N$. To see why, consider the addition $m_1+666$ and four cases depending on whether there is a carry-over from the units and tens places. For $N$ to remain unchanged we must have $222(\Delta a+\Delta b+\Delta c)-666=0$, or $S=\Delta a+\Delta b+\Delta c=3$.
Since $S$ is not 3 in all cases, $N$ must change in going from $m_1$ to $m_2$. Hence we will always get a unique, correct value for $m$ from $m_1$, $m_2$ and $N$.