GitHunt

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 220 are 1,2,4,5,10,11,20,22,44,55 and 110, which add up to 284.
  • The proper divisors of 284 are 1,2,4,71 and 142, which add up to 220.ย 

๐Ÿš€ 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:

  1. Fork the repository
  2. Create a new branch (feature/new-feature)
  3. Commit your changes
  4. 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)

iamx-ariful-islam/Friend-Number | GitHunt