Populates a given array, arr, with a Collatz sequence, starting the sequence at the positive integer n.
| Parameters |
n : Int Starting point.
arr : Array An array.
|
|---|---|
| Returns |
colArr : Array arr populated with the Collatz sequence.
|
| Errors |
This function does not raise any errors. |
Calculates the nth Fibonacci number.
| Parameters |
n : Int Desired Fibonacci number to calculate.
|
|---|---|
| Returns |
num : Int nth Fibonacci number.
|
| Errors |
This function does not raise any errors. |