login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A090895 a(1)=1 then a(n)=a(n-1)/2 if a(n-1) is even, a(n)=a(n-1)+n otherwise. 6

%I #31 Aug 25 2015 18:14:12

%S 1,3,6,3,8,4,2,1,10,5,16,8,4,2,1,17,34,17,36,18,9,31,54,27,52,26,13,

%T 41,70,35,66,33,66,33,68,34,17,55,94,47,88,44,22,11,56,28,14,7,56,28,

%U 14,7,60,30,15,71,128,64,32,16,8,4,2,1,66,33,100,50,25,95,166,83,156,78,39

%N a(1)=1 then a(n)=a(n-1)/2 if a(n-1) is even, a(n)=a(n-1)+n otherwise.

%C Does a(n)=1 for infinitely many values of n ?

%C 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]

%C a(A208852(n)) = n and a(m) != n for m < A208852(n); A185038(a(n)) = 1. [_Reinhard Zumkeller_, Mar 02 2012]

%H Reinhard Zumkeller, <a href="/A090895/b090895.txt">Table of n, a(n) for n = 1..10000</a>

%F sum(k=1, n, a(k)) seems to be asymptotic to c*n^2 where c=0.57....

%t 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 *)

%o (PARI) a(n)=if(n<2,1,if(a(n-1)%2,a(n-1)+n,a(n-1)/2))

%o (Haskell)

%o a090895 n = a090895_list !! (n-1)

%o a090895_list = 1 : f 2 1 where

%o f x y = z : f (x + 1) z where

%o z = if m == 0 then y' else x + y; (y',m) = divMod y 2

%o -- _Reinhard Zumkeller_, Mar 02 2012

%Y Cf. A135287, A185038.

%K nonn

%O 1,2

%A _Benoit Cloitre_, Feb 25 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)