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 A346965 #65 Mar 27 2025 10:14:58 %S A346965 0,0,1,0,1,1,3,0,4,1,3,1,2,3,2,0,3,4,4,1,1,3,2,1,5,2,17,3,4,2,16,0,6, %T A346965 3,2,4,4,4,6,1,17,1,6,3,4,2,16,1,5,5,5,2,2,17,17,3,7,4,6,2,3,16,15,0, %U A346965 6,6,5,3,3,2,16,4,18,4,2,4,5,6,6,1,4,17,17 %N A346965 a(n) is the number of ascending subsequences in reducing n to 1 using the Collatz reduction, or -1 if n refutes the Collatz conjecture. %C A346965 In this sequence, a subsequence is considered ascending for as long as a (3*n + 1) / 2 step is required. %H A346965 Douglas Boffey, <a href="/A346965/b346965.txt">Table of n, a(n) for n = 1..20000</a> %H A346965 Douglas Boffey, <a href="/A346965/a346965.c.txt">Code used for generating b-file</a> %F A346965 a(2^n) = 0. %F A346965 a((2^n*(2*x+1)-1) * 2^y) = a(3^n*(2*x+1)-1) + 1, where x, y >= 0. %F A346965 a(n) = a(A085062(n)) + (n mod 2) for n >= 2. - _Alan Michael Gómez Calderón_, Feb 09 2025 %F A346965 a(n) = A160541(A000265(n)). - _Alan Michael Gómez Calderón_, Mar 19 2025 %e A346965 a(9) = 4, viz. %e A346965 9->14; %e A346965 14->7->11->17->26; %e A346965 26->13->20; %e A346965 20->10->5->8. %o A346965 (C) /* A007814 */ %o A346965 int num_clear_bits(unsigned n) { %o A346965 if (n == 0) %o A346965 return -1; %o A346965 return log2(n & -n); %o A346965 } %o A346965 int A346965(unsigned n) { %o A346965 int x; %o A346965 int result = 0; %o A346965 n >>= num_clear_bits(n); %o A346965 while (n > 1) { %o A346965 x = num_clear_bits(n + 1); %o A346965 n = ((n >> x) + 1) * pow(3, x) - 1; %o A346965 n >>= num_clear_bits(n); %o A346965 ++result; %o A346965 } %o A346965 return result; %o A346965 } %Y A346965 Cf. A000265, A070168, A078719, A085062, A160541, A221469. %K A346965 nonn %O A346965 1,7 %A A346965 _Douglas Boffey_, Aug 09 2021