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
 A: $10^{50}$ is a 51-digit number. And in a 50-digit number, the digit 26th from the left is represented by $10^{24}$.
Other than these two mistakes, I find your approach entirely reasonable. And if they were looking for a 51-digit number, with all except the 25th digit from the left being $1$, then it would've been correct too.
Edit: After having corrected these two off-by-one errors, the solution looks fine.
A: Another way is to use the trick from Wikipedia (that doesn't solve your solution)
Taking $N$ from the right, and applying the sequence $(1, −3, −4, −1, 3, 4)$ as instructed on the page (multiply the digits from the right by the given numbers in sequence), we get
$0$ for the 6 first digits from the right ($1-3-4-1+3+4=0$), repeating the sequence, $0$ up to digit 24 (from right), we still have $0$
Then, the next $6$ are our $a$ and $5\times 1$, or
$$a-3-4-1+3+4\\=a-1$$
We did $30$ digits, $20$ to go. The next $18$ will give $0$, the last $2$ give $1-3$, thus the whole sum is $$a-1-2=a-3$$
The only digit that would have $a-3\equiv 0\pmod {13}$ is $$\bbox[5px,border:2px solid #ba9]{a=3}$$
A: 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$.
