Python script for calculating infinite series
- Python 3
fractions
andargparse
packages (both in standard Python library)
First, download or clone the repository
git clone https://github.com/quailcoral/infinite-adder.git
cd infinite-adder
To use the script, run
python3 infinite-adder.py
This defaults to 10 iterations of the 1/2 series with coefficient 1.
To customize the series, add inputs at the end. This example will run 20 iterations of the 2/3 series multiplied by 1/2, summing 1/2*((2/3)^1+(2/3)^2+(2/3)^3...) = 1
python3 infinite-adder.py 2/3 1/2 -i 20
To access the help screen, run
python3 infinite-adder.py --help