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.
That's also why 1 is not a prime number (2 is the smallest prime), because it would contradict the uniqueness (i.e. 6 is product of unique primes: 3 x 2. It is not 3 x 2 x 1 or 3 x 2 x 1 x 1, etc)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #5: Smallest multiple
You are viewing a single comment's thread. Return to all comments →
yes, every positive integer can be represented as a unique product of primes. It is known as "Fundamental Theorem of Arithmetic" or "Unique Prime Factorization Theorem" https://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic
That's also why 1 is not a prime number (2 is the smallest prime), because it would contradict the uniqueness (i.e. 6 is product of unique primes: 3 x 2. It is not 3 x 2 x 1 or 3 x 2 x 1 x 1, etc)