This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A225570 #16 Aug 11 2013 15:33:06 %S A225570 1,2,4,8,16,5,10,20,40,13,26,52,17,34,11,22,7,14,28,56,112,37,74,148, %T A225570 49,98,196,65,130,43,86,172,344,688,229,458,916,305,610,203,406,812, %U A225570 1624,541,1082,2164,721,1442,2884,961,1922,3844,7688,15376,5125,10250 %N A225570 The greedy smallest infinite reverse Collatz (3x+1) sequence. %C A225570 For each a(n) (where n > 4), a(n) = (a(n-1) - 1)/3 if the result is an odd integer not divisible by 3. Otherwise a(n) = 2 * a(n-1). %C A225570 Going backwards from any term a(n) to a(1), this is the Collatz sequence for a(n). Furthermore, each term in the sequence is the smallest possible term (ignoring multiples of 3) with this property given the previous term. %C A225570 Multiples of 3 are ignored because after visiting a multiple of 3, subsequent terms can only double. %H A225570 T. D. Noe, <a href="/A225570/b225570.txt">Table of n, a(n) for n = 1..1000</a> %p A225570 A225570 := proc(n) %p A225570 local a; %p A225570 option remember; %p A225570 if n <= 4 then %p A225570 2^(n-1) ; %p A225570 else %p A225570 a := (procname(n-1)-1)/3 ; %p A225570 if type(a,'integer') and type(a,'odd') and modp(a,3) <> 0 then %p A225570 return a; %p A225570 else %p A225570 return procname(n-1)*2 ; %p A225570 end if; %p A225570 end if; %p A225570 end proc: # _R. J. Mathar_, Aug 03 2013 %t A225570 last = 8; Join[{1, 2, 4, 8}, Table[test = (last - 1)/3; If[OddQ[last] || ! IntegerQ[test] || IntegerQ[test/3], last = 2*last, last = (last - 1)/3]; last, {96}]] (* _T. D. Noe_, Aug 11 2013 *) %Y A225570 Cf. A014682, A070165. %K A225570 nonn %O A225570 1,2 %A A225570 _David Spies_, Jul 29 2013