A Python library that generates integer sequences
Project description
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
Authors
Contributing
Contributions are always welcome!
See contributing.md
for ways to get started.
Project details
Release history Release notifications | RSS feed
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)