Skip to main content

A commons library for Project Euler problems.

Project description

Leonhard

A commons library for Project Euler problems.

Installation

pip install leonhard

Usage

>>> from leonhard import leonhard
>>> print(leonhard.get_factors_of_positive_integer(10))
[1, 2, 5, 10]

Functionalities

  • get_factors_of_positive_integer: Gets the factors of a given positive integer
  • generate_fibonacci_sequence: Generates a Fibonacci sequence
  • is_prime: Checks if a number is prime or not
  • is_pythagorean_triplet: Checks if a^2 + b^2 = c^2 where a < b < c
  • count_digits: Counts the number of digits of a given number
  • generate_collatz_sequence: Generates a collatz sequence
  • generate_cyclic_permutation: Generates the list of cyclic permutation of a given number
  • is_triangle_number(): Checks if a number is triangular or not

Samples

Sample files are found in samples/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for leonhard, version 1.6.3
Filename, size File type Python version Upload date Hashes
Filename, size leonhard-1.6.3-py3-none-any.whl (9.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size leonhard-1.6.3.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page