login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1
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, 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, 6, 6, 5, 3, 3, 2, 16, 4, 18, 4, 2, 4, 5, 6, 6, 1, 4, 17, 17 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,7
COMMENTS
In this sequence, a subsequence is considered ascending for as long as a (3*n + 1) / 2 step is required.
LINKS
FORMULA
a(2^n) = 0.
a((2^n*(2*x+1)-1) * 2^y) = a(3^n*(2*x+1)-1) + 1, where x, y >= 0.
EXAMPLE
a(9) = 4, viz.
9->14;
14->7->11->17->26;
26->13->20;
20->10->5->8.
PROG
(C) /* A007814 */
int num_clear_bits(unsigned n) {
if (n == 0)
return -1;
return log2(n & -n);
}
int A346965(unsigned n) {
int x;
int result = 0;
n >>= num_clear_bits(n);
while (n > 1) {
x = num_clear_bits(n + 1);
n = ((n >> x) + 1) * pow(3, x) - 1;
n >>= num_clear_bits(n);
++result;
}
return result;
}
CROSSREFS
Sequence in context: A129718 A127375 A238573 * A325491 A195084 A306803
KEYWORD
nonn
AUTHOR
Douglas Boffey, Aug 09 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:06 EDT 2024. Contains 371967 sequences. (Running on oeis4.)