login
A271623
a(0)=7; a(n) = 7*a(n-1) + 1 if a(n-1) is odd, a(n) = a(n-1)/2 otherwise.
0
7, 50, 25, 176, 88, 44, 22, 11, 78, 39, 274, 137, 960, 480, 240, 120, 60, 30, 15, 106, 53, 372, 186, 93, 652, 326, 163, 1142, 571, 3998, 1999, 13994, 6997, 48980, 24490, 12245, 85716, 42858, 21429, 150004, 75002, 37501, 262508, 131254, 65627, 459390, 229695
OFFSET
0,1
COMMENTS
Conjectured: No term of the sequence is equal to a previous term.
EXAMPLE
7 is odd, so it is followed by 7*7 + 1 = 50.
50 is even, so it is followed by 50/2 = 25.
MATHEMATICA
NestList[If[EvenQ[#], #/2, 7 # + 1]&, 7, 60]
PROG
(Magma) [n eq 1 select 7 else IsOdd(Self(n-1)) select 7*Self(n-1)+1 else Self(n-1) div 2: n in [1..60]];
(PARI) Collatz(n, lim=0) = {my(c=n, e=0, L=List(n)); if(lim==0, e=1; lim=n*10^2);
for(i=1, lim, if(c%2==0, c=c/2, c=7*c+1); listput(L, c); if(e&&c==1, break)); return(Vec(L)); }
print(Collatz(7)) \\ Adapted from A008884 \\ Altug Alkan, Apr 11 2016
CROSSREFS
Sequence in context: A069032 A345975 A368113 * A153693 A293475 A293801
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Apr 11 2016
STATUS
approved