$N$ is a $50$ digit number (in the decimal scale). All digits except the $26^{th}$ digit (from the left) are $1$. If $N$ is divisible by $13$, find the $26^{th}$ digit.
This question was asked in RMO $1990$ and is very similar to this question and the same as this question but it is not solved by the approach used by me whereas I want to verify my approach.
My approach:
Suppose $N=111\cdots a\cdots111$ and $N\equiv 0\pmod {13}$
Now $N=10^{49}+10^{48}+\ldots+a10^{24}+\ldots+10+1=(10^{49}+10^{48}\ldots+10+1)+(a-1)10^{24}$
$N=\dfrac{10^{50}-1}{9}+(a-1)10^{24}$
Now $10^{12}\equiv 1\pmod {13}\Rightarrow 10^{24}\equiv 1\pmod {13}$ by fermat's little theorem.
Thus $(a-1)10^{24}\equiv (a-1) \pmod{13}\Rightarrow \dfrac{10^{50}-1}{9}\equiv 1-a\pmod{13}$ since $N\equiv 0\pmod{13}$
$10^{24}\equiv 1\pmod{13}\Rightarrow 10^{48}\equiv 1\pmod{13}$ or $10^{50}-1\equiv -5 \pmod{13}$
Now $10^{50}-1\equiv -5\pmod {13}\Rightarrow 9(1-a)\equiv -5\pmod{13}$
$a=3$ clearly satisfies the above conditions
$\therefore$ The $26^{th}$ digit from the left must be $3$.
Please suggest what is incorrect in this solution and advice for alternative solutions.
THANKS