<s>[INST] Find the $26^{th}$ digit of a $50$ digit number divisible by $13$. $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
 [/INST] After your editions, your approach is correct. Here's an alternative one:
The number $N$ consists of $24$ ones followed by the two digits $1a$ (the $2$-digit number $10+a$) followed by another $24$ ones, so with the number $M$ consisting of $24$ ones, $M:=\sum_{k=0}^{23}10^k=\frac{10^{24}-1}{9}$, we have
$$N=M\cdot10^{24+2}+(10+a)\cdot10^{24}+M$$
Since $13$ is a prime, from Fermat's Little Theorem we know that $10^{12}\equiv1\pmod{13}$, and it follows that $13\mid(10^{12}-1)(10^{12}+1)=10^{24}-1=9M \Rightarrow 13\mid9 
\lor 13\mid M$. Obviously, $13\nmid 9$, so $13\mid M$.
Now, if $13\mid N$, it follows that $13\mid (10+a)\cdot10^{24}$, and since $13\nmid10^{24}$, it must be $13\mid10+a$. Since $0\le a\le9$, it must be $a=3$.
</s>