PrimeSense is a Python project that offers powerful functionalities to find prime numbers within a specified range using the Sieve of Eratosthenes algorithm. This project includes features to calculate prime statistics, such as the count of primes and the last three prime numbers in a given range.
- Sieve of Eratosthenes Algorithm: Efficiently calculates all prime numbers up to a given
n
. - Range-based Prime Finder: Finds all prime numbers within a specified range
[start, end]
. - Prime Statistics: Provides the count of prime numbers and the last three prime numbers in the specified range.
- User Input Validation: Ensures user inputs for range are valid and handles errors gracefully.
Returns a list of prime numbers up to n
using the Sieve of Eratosthenes algorithm.
Finds all prime numbers in the range [start, end]
.
Provides the last three prime numbers and the count of prime numbers in the range [start, end]
.
Prompts the user to enter the start and end of the range, with validation.
Displays the results of the prime number calculations.
To use PrimeSense, simply execute the main()
function which prompts for user input and then displays the calculated prime statistics.
python primesense.py
Contributions are welcome! If you have suggestions or improvements, please fork the repository and create a pull request or email your respond to me.
mahnaznamani007@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details.
Ensure that the file name `primesense.py` matches the actual name of your Python script. This `README.md` provides a comprehensive overview of the PrimeSense project, its features, usage instructions, and guidelines for contributing.