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 A341516 #7 Feb 15 2021 22:50:56 %S A341516 1,3,2,6,3,7,5,12,4,27,7,14,11,75,6,24,13,35,17,54,10,147,19,28,9,363, %T A341516 8,150,23,13,29,48,14,507,15,70,31,867,22,108,37,343,41,294,12,1083, %U A341516 43,56,25,63,26,726,47,175,21,300,34,1587,53,26,59,2523,20,96,33,847,61,1014,38,243,67,140,71,2883,18,1734 %N A341516 The Collatz or 3x+1 function T (A014682) conjugated by unary-binary-encoding (A156552). %C A341516 Collatz-conjecture can be formulated via this sequence by postulating that all iterations of a(n), starting from any n > 1, will eventually end reach the cycle [2, 3]. %H A341516 Antti Karttunen, <a href="/A341516/b341516.txt">Table of n, a(n) for n = 1..10000</a> %H A341516 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %H A341516 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a> %F A341516 If n is odd, then a(n) = A064989(n), otherwise a(n) = A064989(A329603(n)). %F A341516 a(n) = A005940(1+A014682(A156552(n))). %o A341516 (PARI) %o A341516 A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); }; %o A341516 A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)}; %o A341516 A156552(n) = { my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res }; %o A341516 A329603(n) = A005940(2+(3*A156552(n))); %o A341516 A341516(n) = if(n%2, A064989(n), A064989(A329603(n))); %Y A341516 Cf. A005940, A014682, A064989, A156552, A329603. %Y A341516 Cf. A341515 for a variant. %K A341516 nonn %O A341516 1,2 %A A341516 _Antti Karttunen_, Feb 15 2021