Skip to content

Utils

geronimo.util.fibonacci(n: int) -> int cached

Returns the nth number in the Fibonacci series, starting to count at zero. Only works for the positive Fibonacci series. Uses caching to be more efficient.

So fib(0) = 1, fib(1) = 1, fib(2) = 2, fib(3) = 3, fib(4) = 5, ...

geronimo.util.greatest_common_divisor(a: int, b: int) -> int cached

Uses the iterative modern Euclidean algorithm to quickly find the greatest common divisor for two integers, a and b.