Let n be a prime. By condition (1) the sequence a0,a1,… contains only finitely many different numbers. If am is maximal of them, then by condition (3) am+am must also be maximal. Let us prove that if am is maximal of the numbers, then am+k⋅am is also maximal for any k≥0. This holds for k=0. If the claim holds for k, then am+(k+1)⋅am=am+k⋅am+am=am+k⋅am+am+k⋅am=am+k⋅am=am. This proves the claim. By condition (2) am is not divisible by n. Since n is prime, the numbers am and n are relatively prime. Hence among the numbers m+k⋅am, where 0≤k<n, there is one in each congruence class modulo n. Hence all members of the sequence are maximal, i.e. they are equal.
Suppose n is a composite number; let m be its divisor with 1<m<n. For any k<m choose ak=m+k⋅n and continue the sequence with period m. Condition (1) holds, since n is a multiple of m. Condition (2) holds, since all members of the sequence are congruent to m modulo n. For the condition (3) notice that all members of the sequence are divisible by m. Hence i and i+ai are always congruent modulo m, therefore ai=ai+ai. At the same time not all the numbers are equal.