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 A261702 #20 Apr 25 2016 12:00:16 %S A261702 1,2,4,8,16,5,10,3,6,12,20,24,32,40,13,26,48,52,17,34,11,22,7,14,28,9, %T A261702 18,36,44,56,64,21,42,68,72,80,84,88,29,58,19,38,76,25,50,96,100,33, %U A261702 66,104,112,37,74,116,128,132,136,45,90,144,148,49,98,152 %N A261702 a(1) = 1; for n>1, a(n) is the smallest positive integer not already present which is entailed by the rules (i) k present => 2k present; (ii) 3k+1 present and k odd => k present. %C A261702 If the Collatz 3n+1 conjecture is true, then this is a permutation of all positive integers. See A261715 for putative inverse. %H A261702 Paul Tek, <a href="/A261702/b261702.txt">Table of n, a(n) for n = 1..10000</a> %H A261702 Paul Tek, <a href="/A261702/a261702.pl.txt">PERL program for this sequence</a> %H A261702 Paul Tek, <a href="/A261702/a261702.cpp.txt">C++ program for this sequence</a> %H A261702 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %p A261702 a:= proc() local a, b, s; b, s:= proc() true end, %p A261702 heap[new]((x, y)-> is(x>y), 1); a:= %p A261702 proc(n) option remember; local k, t; %p A261702 if n>1 then a(n-1) fi; %p A261702 t:= heap[extract](s); b(t):= false; %p A261702 k:= 2*t; if b(k) then heap[insert](k, s) fi; %p A261702 if irem(t-1, 3, 'k')=0 and (k::odd) and %p A261702 b(k) then heap[insert](k, s) fi; t %p A261702 end %p A261702 end(): %p A261702 seq(a(n), n=1..80); # _Alois P. Heinz_, Aug 29 2015 %o A261702 (Perl) See Links section. %o A261702 (C++) See Links section. %Y A261702 Cf. A088975, A033491, A109732, A261690, A261715 (putative inverse). %K A261702 nonn,look %O A261702 1,2 %A A261702 _Paul Tek_, Aug 28 2015