Utilities
oeis_code.utils.math
fibonacci_term(n)
Calculate the n-th Fibonacci number (0-indexed). A000045: 0, 1, 1, 2, 3, 5, ...
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The index of the term. |
required |
Returns:
| Type | Description |
|---|---|
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:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if n is prime, False otherwise. |