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 A348094 #14 Apr 05 2024 10:07:14 %S A348094 2,4,35,8,21,70,2055,16,8201,42,1035,140,141,4110,4111,32,529,16402, %T A348094 16403,84,85,2070,2071,280,65561,282,1180591620717411303451,8220,8221, %U A348094 8222,147573952589676412959,64,262177,1058,1059,32804,32805,32806,8388647,168 %N A348094 If the Collatz trajectory of n reaches 1, say after k steps, and there is an integer m > n such that T^i(m) and T^i(n) have the same parity for i = 0..k (where T^i denotes the i-th iterate of the Collatz map A006370), then a(n) is the least such m, otherwise a(n) is -1. %C A348094 When a(n) > 0, the binary expansion of A125711(n) is a prefix of that of A125711(a(n)). %H A348094 Paolo Xausa, <a href="/A348094/b348094.txt">Table of n, a(n) for n = 1..10000</a> %H A348094 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A348094 a(2^k) = 2^(k+1) for any k >= 0. %F A348094 a(n) = n + 2^A006666(n) when A006666(n) >= 0. %e A348094 The first terms, alongside the binary representations of A125711(n) and of A125711(a(n)), are: %e A348094 n a(n) h(n) h(a(n)) %e A348094 - ---- ----------------- -------------------------------------- %e A348094 1 2 1 11 %e A348094 2 4 11 111 %e A348094 3 35 10101111 10101111101111 %e A348094 4 8 111 1111 %e A348094 5 21 101111 10111111 %e A348094 6 70 110101111 110101111101111 %e A348094 7 2055 10101011011101111 10101011011101111110111010101111101111 %e A348094 8 16 1111 11111 %t A348094 A348094[n_] := n+2^(Length[NestWhileList[If[OddQ[#], 3#+1, #]/2 &, n, #>1 &]]-1); %t A348094 Array[A348094, 50] (* _Paolo Xausa_, Apr 05 2024 *) %o A348094 (PARI) a(n) = { my (h=0, r=n); while (r>1, if (r%2, r=3*r+1, r=r/2; h++)); n+2^h } %Y A348094 Cf. A006370, A006666, A070165, A125711. %K A348094 nonn %O A348094 1,1 %A A348094 _Rémy Sigrist_, Sep 29 2021