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 A304715 #16 Nov 09 2018 22:16:07 %S A304715 0,1,28,3,14,57,1896,7,7586,29,948,115,118,3793,3824,15,474,15173, %T A304715 15180,59,62,1897,1912,231,60722,237,1102691417057682138372,7587,7590, %U A304715 7649,137836427132210267296,31,242890,949,956,30347,30350,30361,7772616,119 %N A304715 For any n > 0, if A006666(n) >= 0, then a(n) = Sum_{i = 0..A006666(n)-1} 2^i * [T^i(n) == 0 (mod 2)] (where [] is an Iverson bracket and T^i denotes the i-th iterate of the Collatz function A014682); otherwise a(n) = -1. %C A304715 In other words, when a(n) >= 0, the binary representation of a(n) encodes the tripling and halvings steps of the Collatz compressed trajectory of n up to the first occurrence of the number 1 (where zeros and ones respectively denote tripling and halving steps). %H A304715 Rémy Sigrist, <a href="/A304715/b304715.txt">Table of n, a(n) for n = 1..10000</a> %H A304715 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A304715 a(2^k) = 2^k - 1 for any k >= 0. %F A304715 a(2*n) = 2*a(n) + 1. %F A304715 A029837(a(n)+1) = A006666(n). %F A304715 A000120(a(n)) = A220071(n). %F A304715 a(A248573(n)) < a(A248573(n+1)) for any n >= 0. - _Rémy Sigrist_, Nov 09 2018 %e A304715 The first terms, alongside the binary representation of a(n) and the Collatz compressed trajectory of a(n) up to the first 1 in reverse order, are: %e A304715 n a(n) bin(a(n)) rev(traj(n)) %e A304715 -- ---- --------- ------------ %e A304715 1 0 0 (1) %e A304715 2 1 1 (1, 2) %e A304715 3 28 11100 (1, 2, 4, 8, 5, 3) %e A304715 4 3 11 (1, 2, 4) %e A304715 5 14 1110 (1, 2, 4, 8, 5) %e A304715 6 57 111001 (1, 2, 4, 8, 5, 3, 6) %e A304715 7 1896 11101101000 (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7) %e A304715 8 7 111 (1, 2, 4, 8) %e A304715 9 7586 1110110100010 (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7, 14, 9) %e A304715 10 29 11101 (1, 2, 4, 8, 5, 10) %e A304715 11 948 1110110100 (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11) %e A304715 12 115 1110011 (1, 2, 4, 8, 5, 3, 6, 12) %e A304715 13 118 1110110 (1, 2, 4, 8, 5, 10, 20, 13) %e A304715 14 3793 111011010001 (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7, 14) %e A304715 15 3824 111011110000 (1, 2, 4, 8, 5, 10, 20, 40, 80, 53, 35, 23, 15) %e A304715 16 15 1111 (1, 2, 4, 8, 16) %e A304715 17 474 111011010 (1, 2, 4, 8, 5, 10, 20, 13, 26, 17) %e A304715 18 15173 11101101000101 (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7, 14, 9, 18) %o A304715 (PARI) a(n) = my (v=0); for (k=0, oo, if (n==1, return (v), n%2, n = (3*n+1)/2, n = n/2; v += 2^k)) %Y A304715 Cf. A000120, A006666, A014682, A029837, A220071, A248573. %K A304715 nonn,base,look %O A304715 1,3 %A A304715 _Rémy Sigrist_, May 17 2018