numbers.generate

numbers.generate.collatz(n, arr)

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.


numbers.generate.fibonacci(n)

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.