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 A340407 #76 May 07 2021 00:49:19 %S A340407 2,5,1,4,5,1,4,2,1,2,3,1,5,5,1,6,2,1,2,5,1,3,3,1,3,2,1,2,4,1,6,10,1,5, %T A340407 2,1,2,3,1,5,8,1,4,2,1,2,4,1,3,3,1,3,2,1,2,18,1,5,4,1,6,2,1,2,3,1,4,4, %U A340407 1,5,2,1,2,7,1,3,3,1,3,2,1,2,7,1,4,9,1,4,2,1 %N A340407 a(n) gives the number of side-branches that will be passed, if A342369 is used to trace the Collatz tree backward starting at 6*n-2 with n > 0. %C A340407 Recursion into A342369 means tracing the Collatz tree backward, starting at k = A342369(6*n-2), then k = A342369(k) until k is divisible by 3. At each A342369(k) = 3*m - 1, a new side-branch is connected which would start at 6*m-2. If A342369(k) reached a value divisible by three no further side-branches will be found. %C A340407 This sequence is a rearrangement of A087088 such that all values at positions divisible by 3 are unchanged. %H A340407 Thomas Scheuerle, <a href="/A340407/b340407.txt">Table of n, a(n) for n = 1..5000</a> %H A340407 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A340407 a(n) > 0. %F A340407 a(3*n) = 1. %F A340407 a(9*n - b) = 2, b = {1, 8} row 2 of A342261. ( a(A056020(n)) = 2 ). %F A340407 a(27*n - b) = 3, b = {2, 4, 5, 16} row 3 of A342261. %F A340407 a(81*n - b) = 4, b = {13, 14, 22, 34, 38, 52, 74, 77} row 4 of A342261. %F A340407 a(3^k*n - b) = k, b = row k of A342261. %F A340407 ( Sum_{k=1..j} a(k) )/j lim_{j->infinity} = 3 = Sum_{k=1..infinity} k*2^(k-1)/3^k. %e A340407 n = 2: %e A340407 6*n-2 = 10. %e A340407 A342369(10) = 20. -> 7*3 - 1 -> A side-branch is connected. %e A340407 A342369(20) = 13. %e A340407 A342369(13) = 26. -> 9*3 - 1 -> A side-branch is connected. %e A340407 A342369(26) = 17. -> 6*3 - 1 -> A side-branch is connected. %e A340407 A342369(17) = 11. -> 4*3 - 1 -> A side-branch is connected. %e A340407 A342369(11) = 7. %e A340407 A342369(7) = 14. -> 5*3 - 1 -> A side-branch is connected. %e A340407 A342369(14) = 9. -> divisible by 3 we stop here. %e A340407 -> We found 5 connected side-branches, a(2) = 5. %o A340407 (MATLAB) %o A340407 function a = A340407( max_n ) %o A340407 for n = 1:max_n %o A340407 c = 0; %o A340407 s = 6*n -2; %o A340407 while mod(s,3) ~= 0 %o A340407 s = A342369( s ); %o A340407 if mod(s,3) == 2 %o A340407 c = c+1; %o A340407 end %o A340407 end %o A340407 a(n) = c; %o A340407 end %o A340407 end %o A340407 function b = A342369( n ) %o A340407 if mod(n,3) == 2 %o A340407 b = (2*n - 1)/3; %o A340407 else %o A340407 b = 2*n; %o A340407 end %o A340407 end %Y A340407 Cf. A014682, A342369, A342261, A087088. %K A340407 nonn %O A340407 1,1 %A A340407 _Thomas Scheuerle_, Mar 24 2021