Utilities
oeis_code.utils.math
Number theory helpers: trial-division primality and Fibonacci.
fibonacci_term(n)
Calculate the n-th Fibonacci number (0-indexed).
A000045: 0, 1, 1, 2, 3, 5, ...
Parameters
n : int The index of the term.
Returns
int The n-th Fibonacci number.
Source code in src/oeis_code/utils/math.py
is_prime(n)
Check if a number is prime using trial division.
Parameters
n : int The number to check.
Returns
bool True if n is prime, False otherwise.