OFFSET
1,2
COMMENTS
Does a(n)=1 for infinitely many values of n ?
It seems that the answer is yes (see A185038). The number a(n) is always in the range on 1 to 3*a(n), and there is an average of 2 addition steps for every 5 steps. In order to reach '1', the sequence must reach a power of two after an addition step, which is likely to happen on an exponential basis. [Sergio Pimentel, Mar 01 2012]
a(A208852(n)) = n and a(m) != n for m < A208852(n); A185038(a(n)) = 1. [Reinhard Zumkeller, Mar 02 2012]
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
sum(k=1, n, a(k)) seems to be asymptotic to c*n^2 where c=0.57....
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[EvenQ[a], a/2, a+n+1]}; Transpose[NestList[nxt, {1, 1}, 80]][[2]] (* Harvey P. Dale, Aug 25 2015 *)
PROG
(PARI) a(n)=if(n<2, 1, if(a(n-1)%2, a(n-1)+n, a(n-1)/2))
(Haskell)
a090895 n = a090895_list !! (n-1)
a090895_list = 1 : f 2 1 where
f x y = z : f (x + 1) z where
z = if m == 0 then y' else x + y; (y', m) = divMod y 2
-- Reinhard Zumkeller, Mar 02 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 25 2004
STATUS
approved