No. You don't always know how long the sequence will be for a particular starting value.
Here is the definition, again:
N/2
3*N + 1
And here is a method:
The method prints out the current N
,
then advances to the next N
by calling itself.
When N
hits one, it returns to its caller,
which returns to its caller, and so on up the chain until the first activation.
The remainder operator %
is used to determine odd or even.
If the remainder after division by two is one,
then the integer is odd.
Fill in the blanks.