login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A363270
The result, starting from n, of Collatz steps x -> (3x+1)/2 while odd, followed by x -> x/2 while even.
3
1, 1, 1, 1, 1, 3, 13, 1, 7, 5, 13, 3, 5, 7, 5, 1, 13, 9, 11, 5, 1, 11, 5, 3, 19, 13, 31, 7, 11, 15, 121, 1, 25, 17, 5, 9, 7, 19, 67, 5, 31, 21, 49, 11, 17, 23, 121, 3, 37, 25, 29, 13, 5, 27, 47, 7, 43, 29, 67, 15, 23, 31, 91, 1, 49, 33, 19, 17, 13, 35, 121, 9, 55
OFFSET
1,6
COMMENTS
Each x -> (3x+1)/2 step decreases the number of trailing 1-bits by 1 so A007814(n+1) of them, and the result of those steps is 2*A085062(n).
LINKS
FORMULA
a(n) = OddPart((3/2)^A007814(n+1)*(n+1) - 1), where OddPart(t) = A000265(t).
a(n) = OddPart(A085062(n)).
MATHEMATICA
OddPart[x_] := x / 2^IntegerExponent[x, 2]
Table[OddPart[(3/2)^IntegerExponent[i + 1, 2] * (i + 1) - 1], {i, 100}]
PROG
(C) int a(int n) {
while (n & 1) n += (n >> 1) + 1;
while (!(n & 1)) n >>= 1;
return n;
}
(PARI) oddpart(n) = n >> valuation(n, 2); \\ A000265
a(n) = oddpart((3/2)^valuation(n+1, 2)*(n+1) - 1); \\ Michel Marcus, May 24 2023
CROSSREFS
Cf. A160541 (number of iterations).
Cf. A075677.
Sequence in context: A215240 A068697 A010258 * A107774 A253685 A122478
KEYWORD
nonn,easy
AUTHOR
Dustin Theriault, May 23 2023
STATUS
approved