Given that the sequence an is the sequence of the ones digit of 3n, find the smallest positive integer A satisfying an+A = an for all positive integer n.
Lemma: Given that a ≡ c (mod n) and b ≡ d (mod n), then ab ≡ cd (mod n)
Proof: a ≡ c (mod n) and b ≡ d (mod n) implies a-c = pn and b-d = qn for some integers p and q
Hence a=pn+c, b=qn+d, ab=(pn+c)(qn+d)=(pqn+pd+qc)n+cd
This implies ab-cd=(pqn+pd+qc)n where (pqn+pd+qc) is an integer, hence ab ≡ cd (mod n)
Solution: We know that a1=3, a2=9, a3=7, a4=1, a5=3 and hence A≥4
Now since an+4 ≡ 3n+4 ≡ 81·3n ≡ 1·3n ≡ 3n ≡ an (mod 10), we find that the remainders of an+4 and an divided by 10 are equal, hence implying that the ones digit of an+4 and an are equal regardless of the value of n. Therefore, A=4.