I saw a mathematician explain how the number 1 is not considered a prime number despite it fitting the traditional definition for a prime number; it is a natural number that can be divided by 1 and by itself yielding a natural number as a result. The explanation apparently lied on the Fundamental Theorem of Arithmetic, stating that every positive whole number can be written as a unique product of primes.

When we divide any number into its prime factors, at first glance we have two options, we can consider 1 to be a prime number and hence a "candidate" prime factor, or we can exclude it from being a prime factor. In the first case, 1 will surely be a factor because every whole number can be divided by 1 yielding a whole number: itself. But since multiplying times 1 does not change the number multiplied, we can include it as a factor infinitely many times, yielding infinitely many expressions all of which, when multiplied together, result in the original number. This would contradict the Fundamental Theorem of Arithmetic, because any positive whole number could then be written as infinite "different" products of primes. But if we exclude 1 from being a prime factor, then every positive whole number can indeed be expressed as a unique product of primes, satisfying the theorem. Hence, 1 is not considered a prime number.

If that is more or less the reasoning, I think I can understand it. However, I am not sure (a · b · 1) can be considered a different expression from (a · b · 1 · 1).

When I think of mathematical operations, I think of change. Every operation I can think of implies the transformation of one fragment of information to another. In that sense, the simplest operation would be a logical inversion, taking a 1-bit value and transforming it to its alternative 1-bit value. Other simple transformations would be binary logical operations; each taking a minimum of two 1-bit values and transforming them into a single bit encoding a different meaning. For example, if a and b are 1-bit values each conveying its own meaning, the operation (a AND b) yields a 1-bit value indicating whether or not both inputs have a specific value I will call "high", whereas the operation (a XOR b) yields a 1-bit value indicating whether both inputs have different or equal values. More complex transformations can be achieved by combining simple transformations. An AND and a XOR performed in parallel on the same two inputs yields two bits containing the arithmetic sum of both inputs; if a third 1-bit input joins in, and further AND, XOR and OR operations are performed in a specific pattern, a full 1-bit addition with carry is achieved. One-bit addition can be extended to n-bit addition, which can be chained into multiplication, which can in turn be chained into powers and factorials, and so on. In general, mathematical operations seem to be methods for the transformation of one or more inputs into a meaningful output.

A computer program could thus be seen as a highly complex mathematical operation, since it too is a process that takes one or more inputs and transforms them into one or more different meaningful outputs, and the idea can be generalised to non-computer programs such as recipes, which are also sequences of operations that enable the transformation between some inputs (the raw ingredients) and some output (the hopefully delicious meal).

But that makes me wonder. If you give me some raw ingredients and I spend one hour in the kitchen doing all sorts of noises, coming out with the same ingredients in the same condition, to what extent can I say I have been cooking? I may have wasted one hour doing who knows what, but the result is equal to me not having done anything in terms of cooking. Likewise, if a mathematical "operation" does not produce any change in its input(s), to what extent can it be said to be an operation? We may call it "adding zero", or "multiplying times one", but those are simply fancy ways of saying "doing nothing". The instruction "take this number and multiply it times one" is equivalent to the instruction "take this number and don't do anything with it".

Of course, in practice it may take time to do nothing, just like I can spend one hour in the kitchen without cooking, and that can itself be used as a feature for synchronisation purposes; a computer program might "waste" a few cycles adding zero to its accumulator in order to adjust the time it takes to perform a broader task. But in the abstract and apparently timeless universe of mathematical theory, what difference would it make to not do anything for longer or shorter?

To me, the expression (a · b) means "take number a and multiply it times number b". The expression (a · b · 1) means "take number a, multiply it times number b and don't do anything to the result". And the expression (a · b · 1 · 1) means "take number a, multiply it times number be, don't do anything to the result and don't do anything to the result". I could go on for ever not doing anything to the result, but that wouldn't mean that I'd be doing something to the result, so I am not sure to what extent I can consider the latter two expressions as being different.

But that is the perspective of someone who is highly ignorant about mathematics. I'd like to know what mathematicians think about this. Thanks!

  • 2
    $\begingroup$ Trust me. Multiplication by 1 is a mathematical operation. So is adding zero. $\endgroup$ – Gerry Myerson Nov 19 '16 at 11:51
  • $\begingroup$ Interestingly, the assembler mnemonic NOP (no operation) translates in some ARM processors to the hexadecimal opcode 0xB000, which is also the opcode for ADD SP, #0 (add zero to the stack pointer). $\endgroup$ – Carvo Loco Nov 19 '16 at 14:14
  • $\begingroup$ @carvo it's problematic to say that "1 fits the traditional description of prime." The exact wording isn't as universal, and as often as not it doesn't fit. It is a bad candidate for a prime in a similar way to reasons against considering $0$ to be prime here $\endgroup$ – rschwieb Nov 19 '16 at 15:07
  • $\begingroup$ They are mathematical operations. But they are the same operation! $\endgroup$ – Jacob Wakem Nov 19 '16 at 20:26
  • $\begingroup$ +,-,*,/,%,pow(), root(), log(), and any other defined f(x)... are all operations on numbers... regardless of what the number, expression or operand is. Another words; if you put it into simple vocabulary of words: I have this and I'm going to do this with it and what will happen to it afterwards... $\endgroup$ – Francis Cugler Apr 18 '18 at 2:39

To start with, whether we consider $1$ to be a prime or not is a matter of convention. It simply turned out to be more useful if we define primes as excluding $1$. Note that we can put a label to arbitrary conditions; I could define an integer to be "maknosentic" if it is larger than $256$, is divisible by at least three and at most five different primes, and differs by no more than $42^{42}$ from a perfect square. It is only that this definition doesn't seem very useful, therefore you'll not find it in the mathematical literature, and you'll probably never will.

The Fundamental Theorem of Arithmetic is just an example of why the definition excluding $1$ is better than the definition including $1$. There are lots of theorems that would have been amended with an exception if $1$ were considered prime. For example, the integers modulo $1$ do not form a field (they consist only of one element; a field needs both $0$ and $1$).

OK, now to your actual question:

Yes, adding zero or multiplying by one are mathematical operations. Note that doing nothing also is a mathematical operation (the identity operation).

Also, an expression is something you write down on paper. For example, the expression $3\cdot 5$ is a different expression than the expression $5\cdot 3$, despite the fact that they both describe the multiplication of $3$ and $5$, and we have $3\cdot 5=5\cdot 3$. Indeed, both also describe the same prime factorization of $15$. So $15$ has only one prime factorization, but two expressions describing it.

And for the same reason, $a\cdot b\cdot 1\cdot1$ is a different expression that $a\cdot b\cdot 1$.

  • $\begingroup$ (+1) LOL at "maknosentic". Is there such a word? $\endgroup$ – yoyostein Nov 19 '16 at 15:48
  • 2
    $\begingroup$ @yoyostein: I just made it up from "makes no sense." $\endgroup$ – celtschk Nov 19 '16 at 17:17
  • $\begingroup$ Thank you for an interesting answer. But if (3 · 5) and (5 · 3) are different expressions, wouldn't that mean that the number 15 can be expressed as two different products of primes? 3 · 5 and 5 · 3. Doesn't that break the constraint of uniqueness conveyed by the Fundamental Theorem of Arithmetic? $\endgroup$ – Carvo Loco Nov 19 '16 at 18:01
  • 2
    $\begingroup$ @CarvoLoco: No, because the theorem states that the product of primes is unique up to the order of the factors. That is, two products that only differ in the order of factors are considered the same factorization. $\endgroup$ – celtschk Nov 19 '16 at 18:08
  • $\begingroup$ Oh, I see. That other mathematician hadn't explained that point. Thanks! $\endgroup$ – Carvo Loco Nov 19 '16 at 18:09

I'd like to know what mathematicians think about this.

Well, since you asked...

After growing up thinking of natural numbers this way in a home-baked way, a mathematician (and others) will eventually encounter the natural numbers, integers or reals axiomatically described as a set with two operations.

Not only are $0$ and $1$ included in the operations, they are actually very special players in the definition: they are the additive and multiplicative identities.

This becomes the de facto picture for the natural numbers, integers, real numbers, etc, and typically the student has no qualms letting go of the old picture in favor of the new one. If not fully convinced, the von Neumann construction of the naturals, and subsequent constructions for the others, typically puts to rest any worries about the concreteness and properties of these things.

So a mathematician would say: he's, of course adding $0$ and multiplying by $1$ are operations: this is consistently defined in the axioms of the operations.

But of course, it's a decent jump from the home baked picture to this one, so it may be harder to do for some than others. Usually people are won over by the axiomatic picture.


There's no mathematical reason to exclude trivial, identity functions from the definition of 'function'. That definition is that a function $f:X \to Y$ is a subset of $X\times Y$ such that for each $x\in X$, there exist a unique point $y$ such that $(x, y)\in f$. Adding in an extra condition that some $y\not = x$ if $X = Y$ is inelegant and unnecessary.

More to the point, if we exclude trivial functions, then the space of functions on a space no longer behaves well. Functions are not closed under composition: the composition of $x \to x + 1$ and $x \to x - 1$, for example, is now not a function. It's unclear even what the inverse of a function would be in this case. I can no longer add or multiply functions, since I may wind up with $f(x) = x$ somewhere in the mix.

Even more to the point, the number $n$ is not the same as the map $x \to nx$. There's a canonical embedding of $\mathbb{Z}$ into the space of linear maps $\mathbb{Z} \to \mathbb{Z}$ (and similarly for further algebraic structure), but these are fundamentally different things.

Also more to the point, a function is not an algorithm. The former is literally just a subset with a certain nice property; there's no restriction that it be computable, fast in any sense, etc.

And so on.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.