Hacker News new | ask | show | jobs
by moi2388 171 days ago
“ But where the primes are numbers that are the product of just one factor, 1 is the product of zero factors, a very different status.”

What do you mean?

The factors of 3 are 3 and 1. The factors of 1 are 1?

2 comments

6 is the product of the members of the set {2, 3}.

3 is the product of the members of {3}.

1 is the product of the members of the empty set.

3 is also the product of the sets {3, 1}, {3, 1, 1}, etc.

We’re excluding the unit when defining these factor sets (ie, multiplicative identity) because it removes unique factorization.

That 1 is the unit is also why it’s the value for the product of the empty set because we want the product of a union of sets to match the product of a product of sets. But we don’t exclude it from the primes for that reason.

What.

Oh! So it’s like Python’s `reduce(multiply,s,initial=1)`, such that s={} still gets you 1. Alright, that makes sense.

No, you're wrong. The factors of 3 are 3. 1 has no factors.
To be clear, you are talking about "prime factors". 3 and 1 are both "factors" of 3, but 1 is not a prime factor.