Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated primecheck.py to accurately classify squares of prime numbers as composite numbers. #549

Merged
merged 1 commit into from
Oct 30, 2018

Conversation

kushalnaidu
Copy link
Contributor

As the for-loop was looping by two numbers, it would stop at 1 number less than the root of prime squares, resulting it in incorrectly classifying the squares as prime numbers. Incrementing the loop ensures the next number is also considered resulting in accurate classification.

As the for-loop was looping by two numbers, it would stop at 1 number less than the root of prime squares, resulting it in incorrectly classifying the squares as prime numbers. Incrementing the loop ensures the next number is also considered resulting in accurate classification.
@harshildarji harshildarji merged commit 75d11f9 into TheAlgorithms:master Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants