IA
iamx-ariful-islam/Friend-Number
A Python package to find and check Pythagoras friend numbers
Pythagoras Friend Number Finder
๐ Overview
Pythagoras Friend Number Finder is a Python package to find and check Pythagoras friend numbers โ numbers that are amicable pairs, e.g., (220, 284).
- Proper divisors are all the positive divisors of a number, excluding the number itself.
- The proper divisors of
220are1,2,4,5,10,11,20,22,44,55and110, which add up to284. - The proper divisors of
284are1,2,4,71and142, which add up to220.ย
๐ Features
- Check if a given pair are friend numbers.
- Find all friend numbers up to a given limit.
- Find the friend number of a given number.
- View library metadata: version, author, GitHub link.
๐ป Installation
git clone https://github.com/iamx-ariful-islam/friend-number.git
cd friend-number
pip install .
# or
python setup.py install๐ Folder / File Structure
friend_number/
โ
โโโ friend_number.py
โโโ README.md
โโโ setup.py
โโโ test.py๐ Usage
from pythagoras_friend_number import FriendNumber
fnumber = FriendNumber()
print(fnumber.sum_of_divisors(220)) # 284
print(fnumber.check_friend([220, 284])) # True
print(fnumber.find_friends(1000)) # [(220, 284)]
print(fnumber.find_friend(220)) # 284๐ก Notes & Limitations
- Pure Python implementation โ no external dependencies.
- Compatible with Python 3.6+.
Contributing
Contributions, suggestions, and feedback are always welcome! โค๏ธ
To contribute:
- Fork the repository
- Create a new branch (
feature/new-feature) - Commit your changes
- Push and submit a Pull Request
๐ฌ You can also open an issue if youโd like to discuss a feature or report a bug.
For more or connect with me
ย ย ย ย
ย ย ย ย
ย ย ย ย
ย ย ย ย
License
The MIT License (MIT)
On this page
Contributors
MIT License
Created November 6, 2025
Updated November 7, 2025