OFFSET
1,2
COMMENTS
Apparently for initial values (1,2) the sequence is unbounded. What about other initial values?
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..2632
EXAMPLE
a=1,b=2: x=1+2=3, x is odd hence a(3)=3x+1=10;
a=2,b=10: x=2+10=12, x is even hence a(4)=x/2^2=3;
a=10, b=3: x=10+3=13, x is odd hence a(5)=3x+1=40, etc.
MATHEMATICA
a=1; b=2; s={a, b}; Do[y=If[OddQ[x=a+b], 3*x+1, x/2^IntegerExponent[x, 2]]; AppendTo[s, y]; a=b; b=y, {30}]; s
PROG
(PARI) first(n)=if(n<3, return(vector(n, i, i))); my(v=vector(n), x); v[1]=1; v[2]=2; for(k=3, n, x=v[k-2]+v[k-1]; v[k]=if(x%2, 3*x+1, x>>valuation(x, 2))); v \\ Charles R Greathouse IV, Sep 05 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Sep 05 2016
STATUS
approved