Note that
ai+1+1=2(ai+1) or ai+1+1=ai+2ai+ai+2=ai+22(ai+1).
Hence
ai+1+11=21⋅ai+11 or ai+1+11=2(ai+1)ai+2=21⋅ai+11+21.
Therefore,
ak+11=2k1⋅a0+11+i=1∑k2k−i+1εi(1)
where εi=0 or 1.
Multiplying both sides by 2k(ak+1) and putting ak=2014, we get
2k=a0+12015+2015⋅(i=1∑kεi⋅2i−1)
where εi=0 or 1.
Since gcd(2,2015)=1, we have a0+1=2015 and a0=2014. Therefore,
2k−1=2015⋅(i=1∑kεi⋅2i−1)
where εi=0 or 1.
We now need to find the smallest k such that 2015∣2k−1. Since 2015=5⋅13⋅31, from the Fermat little theorem we obtain 5∣24−1, 13∣212−1 and 31∣230−1. We also have lcm[4,12,30]=60, hence 5∣260−1, 13∣260−1 and 31∣260−1, which gives 2015∣260−1.
But 5∤230−1 and so k=60 is the smallest positive integer such that 2015∣2k−1. To conclude, the smallest positive integer k such that ak=2014 is when k=60.
Alternative solution 1:
Clearly all members of the sequence are positive rational numbers. For each positive integer i, we have ai=2ai+1−1 or ai=1−ai+12ai+1. Since ai>0 we deduce that
ai={2ai+1−11−ai+12ai+1 if ai+1>1 if ai+1<1
Thus ai is uniquely determined from ai+1. Hence starting from ak=2014, we simply run the sequence backwards until we reach a positive integer. We compute as follows.
12014,22013,42011,82007,161999,321983,641951,1281887,2561759,5121503,1024991,331982,661949,1321883,2641751,5281487,1056959,971918,1941821,3881627,7761239,1552463,1089926,1631852,3261689,6521363,1304711,5931422,1186829,3571658,7141301,1428587,8411174,1682333,1349666,6831332,1366649,7171298,1434581,8531162,1706309,1397618,7791236,1558457,1101914,1871828,3741641,7481267,1496519,9771038,195461,1893122,1771244,1527488,1039976,631952,1261889,2521763,5041511,10081007,12014.
There are 61 terms in the above list. Thus k=60.
Alternative solution 2:
Start with ak=n0m0 where m0=2014 and n0=1 as in alternative solution 1. By inverting the sequence as in alternative solution 1, we have ak−i=nimi for i≥0 where
(mi+1,ni+1)={(mi−ni,2ni)(2mi,ni−mi) if mi>ni if mi<ni
Easy inductions show that mi+ni=2015, 1≤mi,ni≤2014 and gcd(mi,ni)=1 for i≥0. Since a0∈N+ and gcd(mk,nk)=1, we require nk=1. An easy induction shows that (mi,ni)≡(−2i,2i)(mod2015) for i=0,1,…,k.
Thus 2k≡1(mod2015). As in the official solution, the smallest such k is k=60. This yields nk≡1(mod2015). But since 1≤nk,mk≤2014, it follows that a0 is an integer.