We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The example says 644 has prime factors of "2^2 x 7 x 23".
We know 2 is a prime number. But how is 2^2 a prime factor? It equals 4, which is not a prime number.
And the sample test case says 20 has 2 distinct prime factors. What are they? It can't be 4 and 5, because 4 isn't prime. It can't be 2 and 10, because 10 isn't prime. Is it 2^2 and 5? If so, why is 2^2 allowed, and what are the rules regarding exponents when it comes to prime factors?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #47: Distinct primes factors
You are viewing a single comment's thread. Return to all comments →
The example says 644 has prime factors of "2^2 x 7 x 23".
We know 2 is a prime number. But how is 2^2 a prime factor? It equals 4, which is not a prime number.
And the sample test case says 20 has 2 distinct prime factors. What are they? It can't be 4 and 5, because 4 isn't prime. It can't be 2 and 10, because 10 isn't prime. Is it 2^2 and 5? If so, why is 2^2 allowed, and what are the rules regarding exponents when it comes to prime factors?