<s>[INST] Probability: $a$ chosen randomly from $\{1,2,\dots,n\}$, find $P(a^2=1 \mod 10)$. 
A number $a$ is chosen randomly from the set $\{1, 2,\dots , n\}$. Find 
  
  
*
  
*The probability $p_n$ that $a^2=1 \mod 10 $. 
  
*$\displaystyle \lim_{n\to\infty} p_n$.
  

I found that in $n$ numbers $\{1,2,3,\dots, n\}$ there are $(n-1)/10$ numbers that number $10=1$, $(11,21,31,41,51, \dots)$
Hope for any help. Thanks!
 [/INST] Note that if $a^2 \equiv 1 \pmod{10}$ then we must have that $a^2 \equiv 1 \pmod{5}$ and $a^2 \equiv 1 \pmod{2}$. As both $5$ and $2$ are primes we must have that $a \equiv \pm 1 \pmod 5$ and $a \equiv 1 \pmod 2$. Combining these two with the Chinese Remainder Theorem we have that:
$$a \equiv \pm 1 \pmod{10}$$
So this proves that the only solutions to $a^2 \equiv 1 \pmod{10}$ are the numbers of the type $a=10k + 1$ and $a=10k-1$. To calculate that number you can use String's formula in the comments. 
</s>