• What are the prime factors of 0, really?

    From Peter Luschny@21:1/5 to All on Mon Oct 16 04:04:33 2023
    What are the prime factors of 0, really?

    Many mathematicians have certainly thought about this question,
    but what conclusion did they come to?

    Among these were the developers of the remarkable CAS Maple.
    For decades, they offered the 'numtheory' module and the
    'factorset' function.

    That then gave this answer:

    restart; with(numtheory): seq(factorset(n), n = 0..9);

    {0}, {}, {2}, {3}, {2}, {5}, {2, 3}, {7}, {2}, {3}

    [1] The answer is: PrimeFactors(0) = {0}.

    But one day at the daily meeting, someone said: "Yesterday
    I read Apostol, and he says that every integer divides 0.
    So factorset(0) should be the set of all primes, P, right?"
    The developers were amazed but decided to write a new module.
    This is now called 'NumberTheory' and the function 'PrimeFactors'.

    restart; with(NumberTheory): seq(PrimeFactors(n), n = 1..9);

    {}, {2}, {3}, {2}, {5}, {2, 3}, {7}, {2}, {3}
    PrimeFactors(0); Error, cannot represent all prime factors of 0.

    I suspect that the developers remembered that the set of prime
    numbers, according to Euclid is infinite, and they wanted to
    express this with the error message.

    [2] The answer is: PrimeFactors(0) = P, but sorry.

    But then there is a third answer: Consider the prime
    factorization of n. In Maple, this function is called 'ifactors'
    and looks like this:

    seq(ifactors(n), n = 0..9);

    [0, []], [1, []], [1, [[2, 1]]], [1, [[3, 1]]], [1, [[2, 2]]], ...

    If you only look at the second coordinate of the respective element, you get:

    seq({seq(f[1], f = ifactors(n)[2])}, n = 0..9);

    {}, {}, {2}, {3}, {2}, {5}, {2, 3}, {7}, {2}, {3}

    0 and 1 have no prime factors; all other integers have prime factors, as indicated.

    [3] The answer is: PrimeFactors(0) = {}.

    Looks pretty convincing. Is there anything that speaks against it?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Fateman@21:1/5 to Peter Luschny on Sun Nov 5 19:19:45 2023
    On Monday, October 16, 2023 at 4:04:35 AM UTC-7, Peter Luschny wrote:
    What are the prime factors of 0, really?

    <snip>

    In Maxima, you get this:
    (%i1) ifactors(0);

    ifactors: argument must be a positive integer; found: 0

    -- an error. To debug this try: debugmode(true);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Fateman@21:1/5 to Richard Fateman on Fri Nov 10 07:53:19 2023
    On Sunday, November 5, 2023 at 7:19:47 PM UTC-8, Richard Fateman wrote:
    On Monday, October 16, 2023 at 4:04:35 AM UTC-7, Peter Luschny wrote:
    What are the prime factors of 0, really?

    <snip>

    In Maxima, you get this:
    (%i1) ifactors(0);

    ifactors: argument must be a positive integer; found: 0

    -- an error. To debug this try: debugmode(true);

    In the context of symbolic mathematical computer systems it is useful to consider "factors" in a polynomial domain (say, over the integers), in which an expression factors into "content" and "primitive part".Thus 2*x+4 has content 2, and pp x+2.What are
    the factors of   x+3? content 1, pp x+3.  This doesn't address "prime factors", but it does say that 1 is a factor in this context.
    What about 0?   uh, this actually comes up when one asks what is the gcd(0, x+3)?    answer: x+3.   Acknowledging that x+3 is a factor of 0. what about gcd(0,0)?   answer 0.  why?  It is convenient so that programs don't break. If you insist
    on something else for gcd, then you would need to check for 0 before calling gcd, virtually every place.  So why not just agree about default for gcd inside gcd?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)