It is easy to check that for n=2,4,10 the sequences are (1),(1,3),(1,3,7,9) respectively. Thus these numbers are solution of the given problem. Considering n≥3, if n is odd then gcd(n,2)=1 so clearly a1=1,a2=2 and their sum is divisible by 3, which not satisfy. Hence, n is even. It is easy to check that n=6 or n=8 also do not work. Now we consider n≥12 and separate in the following cases:
1. If n=12k for k≥1 then consider a=6k+1,b=6k−1. Since a is odd then gcd(n,a)∣gcd(n,2a)=gcd(12k,12k+2)=2 so gcd(n,a)=1. Similarly, we have gcd(n,b)=1 so a,b are two consecutive terms in the sequence of n, but a+b=12k which is divisible by 3. This case does not give any solution.
2. If n=12k+2 for k≥1 then consider a=6k+3,b=6k+5. Let denote d=gcd(n,a) then d∣2a=12k+6 so d∣4, but d is odd then d=1, thus gcd(n,a)=1. Similarly, denote d′=gcd(n,b) then d′∣2b=12k+10 so d′∣8, but d′ is odd then d′=1, thus gcd(n,b)=1. Now a,b are consecutive terms in the sequence and 3∣a+b, not satisfies.
3. If n=12k+4 for k≥1 then consider a=6k+1,b=6k−1.
4. If n=12k+6 for k≥1 then consider a=6k+1,b=6k−1.
5. If n=12k+8 for k≥1 then consider a=6k+3,b=6k+1.
6. If n=12k+10 for k≥1 then consider a=6k+1,b=6k−1.