A commons library for Project Euler problems.
- Python 3.x
pip install leonhard
>>> from leonhard import leonhard
>>> print(leonhard.get_factors_of_positive_integer(10))
[1, 2, 5, 10]
get_factors_of_positive_integer
: Gets the factors of a given positive integergenerate_fibonacci_sequence
: Generates a Fibonacci sequenceis_prime
: Checks if a number is prime or notis_pythagorean_triplet
: Checks if a^2 + b^2 = c^2 where a < b < ccount_digits
: Counts the number of digits of a given numbergenerate_collatz_sequence
: Generates a collatz sequencegenerate_cyclic_permutation
: Generates the list of cyclic permutation of a given numberis_triangle_number()
: Checks if a number is triangular or not
Sample files are found in samples/