Amicable numbers are two different numbers related in such a way that the sum of the proper divisors of each is equal to the other number.
The script prints amicable numbers on the command line.
This script is ready to use script to takes an argument and calculates all amicable number pairs smaller than the inputted number.
This script require the math, sys, doctest and time package.
$ git clone https://github.com/StokicDusan/AmicableNumbers
$ cd AmicableNumbers/
In the command line simply invoke the script with one argument:
$ python amicableNumbers.py argv1
- argv1:
Any positive integer
Invoking the script with no or less arguments will run testmod().
The following code block shows examples of calling the amicableNumbers script from terminal.
$ python3 amicableNumbers.py 150
$ python3 amicableNumbers.py 300
[ 220 , 284 ]
$ python3 amicableNumbers.py 2620
[ 220 , 284 ]
[ 1184 , 1210 ]
[ 2620 , 2924 ]
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.