A363270 The result, starting from n, of Collatz steps x -> (3x+1)/2 while odd, followed by x -> x/2 while even.
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
Links
- Dustin Theriault, Table of n, a(n) for n = 1..10000
Programs
-
C
int a(int n) { while (n & 1) n += (n >> 1) + 1; while (!(n & 1)) n >>= 1; return n; }
-
Mathematica
OddPart[x_] := x / 2^IntegerExponent[x, 2] Table[OddPart[(3/2)^IntegerExponent[i + 1, 2] * (i + 1) - 1], {i, 100}]
-
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
Comments