OFFSET
1,5
COMMENTS
The minimum number of steps is A261870(x).
For odd n > 1, a(n) = a(3*n-1) since the first step must be n -> 3n-1.
For even n, a(n) = a(3*n-1) or a(n/2) or their sum a(3*n-1) + a(n/2), depending on which one or both of 3n-1 or n/2 are the minimum steps.
a(2^k) = 1 since the minimum number of steps for 2^k is k steps of x/2..
a(n) = 0 if there's no way to go from n to 1 (if any such n exists).
LINKS
Kevin Ryde, Table of n, a(n) for n = 1..10000
Kevin Ryde, C Code
EXAMPLE
For n=20, the a(20) = 2 ways to go from 20 to 1, by the minimum A261870(20) = 12 steps, are
20, 59, 176, 88, 44, 22, 11, 32, 16, 8, 4, 2, 1
20, 10, 29, 86, 43, 128, 64, 32, 16, 8, 4, 2, 1
This is a case where n is even and 3n-1 and n/2 are the same number of steps so that a(n) = a(3*n-1) + a(n/2).
For n=7, the a(7) = 2 ways are by the sole possible step 7 -> 20 since 7 is odd, followed by each of the a(20) = 2 ways shown above.
PROG
(C) /* See links. */
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Kevin Ryde, Nov 25 2024
STATUS
approved