|
|
A276486
|
|
a(1)=1, a(2)=2; thereafter, denoting x=a(n-1)+a(n-2), we have a(n)=3x+1 if x is odd, otherwise a(n)=x/2^m where 2^m is the maximal power of 2 dividing x.
|
|
1
|
|
|
1, 2, 10, 3, 40, 130, 85, 646, 2194, 355, 7648, 24010, 15829, 119518, 406042, 65695, 1415212, 4442722, 2928967, 22115068, 75132106, 48623587, 371267080, 1259672002, 815469541, 6225424630, 21122682514, 3418513393, 73623587722, 231126303346, 76187472767, 921941328340
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Apparently for initial values (1,2) the sequence is unbounded. What about other initial values?
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|