This project is a perfect number finder implemented in Java. A perfect number is a positive integer that is equal to the sum of its proper positive divisors, excluding the number itself. For example, the first perfect number is 6, because 1, 2, and 3 are its proper positive divisors, and 1 + 2 + 3 = 6.
The project consists of two main files:
App.java
: This is the main file that runs the program.PerfectNumber.java
: This file contains the mathematical operations for finding the perfect number.
- The program has an example method that finds perfect numbers between 1 and 200.
- It also includes a method that allows users to find perfect numbers within a range of their choice.
To use the program, simply run the App.java
file. The program will prompt you to enter a range, and it will then find all the perfect numbers within that range.
Depending on your Java enviroment you may need to complile the Perfectnumber java file using javac in order to run the App.Java file.
- GeeksforGeeks. (n.d.). Perfect number. Retrieved from https://www.geeksforgeeks.org/perfect-number/
- GeeksforGeeks. (n.d.). Measure time taken by a function in Java. Retrieved from https://www.geeksforgeeks.org/measure-time-taken-function-java/
This project is licensed under the terms of the MIT license.