Skip to main content

A Python library that generates integer sequences

Project description

logo
license GitHub Repo stars GitHub forks PyPI

Mathseq


Mathseq is python library that helps to generate inifinite sequences real quick ..

Supported Sequences

  • Fibonacci

  • Lucas Number

  • Prime Number

    • end (Positional Argument)
  • Catalan Number

  • Vaneck's sequence

  • Composite Numbers

  • Pronic Numbers

  • Random sequence

    • seed
    • type
  • Look and say

    • inverse

Installation


Using pip

$ pip install mathseq

Usage


Imports

>>>from mathseq import seq

Create Objects

>>>from mathseq import seq
>>>
>>>fibonacci = seq.fibonacci()
>>>fibonacci
<generator object fibonacci at 0x0000020F83BEC648>
>>>

Iteration

from mathseq import seq

fibonacci = seq.fibonacci()

#printing through desired range
desired_range = 10
for _ in range(desired_range):
    fib = next(fibonacci)
    print(fib)


#keep generating to the infinity
for fib in fibonacci:
    print(fib)

Use List Comprehension

from mathseq import seq

fibonacci = seq.fibonacci()
catalan = seq.catalan_numbers()

fib_list = [next(fibonacci) for _ in range(10)]
cat_list = [next(catalan) for _ in range(10)]

print("List of Fibonacci Numbers",fib_list)
print("List of Catalan Numbers",cat_list)

License

MIT

Authors


Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Project details


Download files

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

Source Distribution

mathseq-0.0.3.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

mathseq-0.0.3-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

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