Skip to main content

A collection of functions to play with Lychrel numbers and other funny mathematical problems

Project description

Lychrel

PyPI version

This is a collection of python functions which implements famous mathematical problems, and it is named after the lychrel numbers.

Under the hood lychrel is implemented in rust thanks to PyO3.

Any contribution is welcome!

Implemented algorithms

  • Lychrel numbers: find first palindrome of the reverse-and-add procedure and determine if a number is a lychrel candidate;
  • Generalized fibonacci sequences: also known as Lucas Sequence;
  • Read out and loud: Given a number, this function compute the sequence of digits resulting from reading out loud the number, grouping together multiples of the same digit if any. E.g. read_out_loud(3211) == 131221 because the number 3211 is read as "one 3, one 2 and two 1s";
  • Kaprekar's routine: an iterative algorithm that, with each iteration, takes a natural number in a given number base, creates two new numbers by sorting the digits of its number by descending and ascending order, and subtracts the second from the first to yield the natural number for the next iteration;

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

lychrel-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (181.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

lychrel-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (181.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

lychrel-0.3.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (341.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

lychrel-0.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (181.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

lychrel-0.3.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (341.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

lychrel-0.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (181.5 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

lychrel-0.3.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (181.4 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page