We have a2015=4531.
We claim that
a4k+1=9k+1,a4k+2=9k+3,a4k+3=9k+4,a4k+4=9k+7
for any integer k≥0. The base cases k=0,1 can be verified directly. Indeed, the first 8 terms are
1, 3, 4, 7, 10, 12, 13, 16.
Now, assume the claim holds for k=0,1,…,n−1. Observe that none of the previous terms is congruent to 2 modulo 3, and all numbers congruent to 1 modulo 3 less than 9n has appeared. Consider the case k=n.
* Since (9n−1)+4=3(3n+1) and 9n+3=3(3n+1), we have a4n+1=9n−1,9n. If (9n+1)+ai=3aj, then ai≡2(mod3), contradiction. Thus, a4n+1=9n+1.
* Since (9n+2)+1=3(3n+1), we have a4n+2=9n+2. If (9n+3)+ai=3aj, then 3∣ai. By the inductive hypothesis, we must have ai=9t+3 for some integer t. Then we have aj=3n+3t+2≡2(mod3), contradiction. Thus, a4n+2=9n+3.
* If (9n+4)+ai=3aj, then ai≡2(mod3), contradiction. Thus, a4n+3=9n+4.
* Since (9n+5)+7=3(3n+4) and (9n+6)+(9n+6)=3(6n+4), we have a4n+1=9n+5,9n+6. If (9n+7)+ai=3aj, then ai≡2(mod3), contradiction. Thus, a4n+4=9n+7.
This proves our claim by induction. Therefore,
a2015=a4×503+3=9×503+4=4531.