
What Is an “Almost Prime” Number? - chablent
https://blogs.scientificamerican.com/roots-of-unity/what-is-an-almost-prime-number/
======
skh
In case anyone reads the article and wonders why 1 is not a prime number I'll
give a brief answer.

A prime number has to have the property that not every number is a multiple of
it. In the language of abstract algebra this means that the ideal generated by
that number is proper (not the entire set of numbers one is considering).

Another reason for discounting 1 as a prime number is that considering 1 to be
a prime destroys the uniqueness of prime factorization. For instance, 24 is
uniquely, up to order of powers of prime factors:

2^3 times 3

If we allow 1 to be prime then I can write 24 as

1^17 times 2^3 times 3

or I can write it as

1^2 times 2^3 times 3

We lose the property that representations of numbers as products of powers of
primes is unique. Thus we have a good reason to discount 1 as being prime and
there aren't any good reasons to count it as a prime.

The definition given in elementary school is not the correct one. It's a
working definition that works well and is correct for all positive integers
except 1. In my experience people remember the definition of: "only divisible
by itself and 1". Then they ask, "Why isn't 1 considered prime then?" It's
because the definition given isn't correct.

~~~
chimeracoder
> A prime number has to have the property that not every number is a multiple
> of it.

I understand why this observation is true given the definition that excludes 1
from being a prime number, but I don't follow why this is a _necessary_
property of prime numbers (justifying the definition in the first place).

~~~
skh
The definition of a prime number is arbitrary. We could have defined the term
“prime number” to mean anything. The question is what concept do we wish to
capture with the definition. If we allow numbers with the property that all
other numbers in the number system are multiples of it then 1 is a prime
number and this destroys uniqueness of prime factorization. Since we want to
keep unique factorization it is convenient to exclude numbers that are called
units (numbers in which all other numbers are multiples of it). Prime ideals
need to be proper subsets of the number system or else we’d have to add the
phrase

“Let P be a proper prime ideal”

to a vast number of theorems. This is inconvenient and allowing units to be
prime doesn’t give any benefits. Only headaches so it’s best to just exclude
them.

~~~
nyc111
> it is convenient to exclude numbers that are called units (numbers in which
> all other numbers are multiples of it).

Thanks for this explanation. I used to be puzzled about 1 being not a prime
but now I feel better.

But can we also propose that 1 should not be considered a number? Because 1 is
the unit with which all other numbers are measured.

~~~
amelius
> But can we also propose that 1 should not be considered a number?

That would (again) destroy a lot of useful properties without any benefit.

> Because 1 is the unit with which all other numbers are measured.

Not sure why this would make you question whether 1 is a number.

~~~
dr_dshiv
Some [0] have claimed that the Pythagoreans didn't consider 1 and 2 to be
numbers, proper. This helps explain why.

[0]
[http://www.math.tamu.edu/~dallen/history/pythag/pythag.html](http://www.math.tamu.edu/~dallen/history/pythag/pythag.html)

~~~
nyc111
The referenced article mention this in passing without giving a reason. But
didn't Pythgoras use musical whole number ratios like 2:1, 3:2 and 4:3?If so
he must have considered 1 and 2 to be numbers.

~~~
dr_dshiv
Sorry to be lazy about citation. Here [1] is a peer reviewed article with
better internal citations about Pythagorean mathematical perspectives on 1 and
2.

It has been argued [2] that the Pythagorean numbers were quite different from
numbers as we think of them in arithmetic. The One (or Oneness), for instance,
is more than the number one. However, because these views extended to at least
10, it isn't an argument for disincluding 1 & 2.

(BTW, [2] is probably the best thing I've ever downloaded from Kindle. Highly
recommended. Be sure to read introduction.)

[1] Caldwell, C. K., & Xiong, Y. (2012). What is the smallest prime?. Journal
of Integer Sequences, 15(2), 3. [2] Guthrie, K. S., & Fideler, D. R. (Eds.).
(1987). The Pythagorean sourcebook and library: an anthology of ancient
writings which relate to Pythagoras and Pythagorean philosophy. Red
Wheel/Weiser.

~~~
nyc111
Thanks for the references. I could only find this online which looks similar
to what you have by the same authors:
[https://cs.uwaterloo.ca/journals/JIS/VOL15/Caldwell2/cald6.p...](https://cs.uwaterloo.ca/journals/JIS/VOL15/Caldwell2/cald6.pdf)
Looks very interesting. Reading it now.

~~~
dr_dshiv
Given that the Pythagoreans believed that "all is number" and worshipped
"Oneness", I'd be surprised if they didn't consider one to be a number

------
alangpierce
Similar amusing math terms are "almost everywhere" and "almost surely"/"almost
never". For example, if you pick a random real number between 0 and 1, it will
almost never be exactly 0.5. It's possible that you'll get 0.5, but the
probability of getting it is exactly 0.

[https://en.wikipedia.org/wiki/Almost_everywhere](https://en.wikipedia.org/wiki/Almost_everywhere)

[https://en.wikipedia.org/wiki/Almost_surely](https://en.wikipedia.org/wiki/Almost_surely)

~~~
perl4ever
I think the proper interpretation of that is that you _can 't_ "pick a random
real number between 0 and 1". After all, you would have to choose an infinite
number of digits.

~~~
AaronFriel
You absolutely can "pick a random real number between 0 and 1", at least for
the sake of mathematical argument. But for an interval [a, b] a random real
number will be x s.t. a <= x <= b is zero. That's because the set {x} has
measure 0.

An even more fun fact is that the probability that the randomly chosen number
is rational is also zero, by the same argument.

However, once one starts to try to describe a distribution over the reals,
e.g.: "let X be a real number chosen from a uniform probability distribution
over [0, 1]", then you run into serious problems. That example begs the
question because there is no uniform probability distribution over that set.

~~~
thaumasiotes
There definitely is a uniform probability distribution over the interval
[0,1]. It is given by the probability density function f(x) = 1. There's no
uniform probability distribution over the reals, or over the integers, but
defining one over a closed real interval is trivially easy. That's what "pick
a random real number between 0 and 1" _means_.

~~~
AaronFriel
I don't believe there is a uniform probability distribution over any interval
of the reals.

Suppose such a distribution existed over [0, 1]. Then as we have shown before,
the probability of choosing 0 <= x <= 1 is zero.

The second axiom of probability states the probability of one of the numbers
being chosen must be is one. The third axiom requires countable additivity.

We can easily see that for our distribution, we cannot satisfy both at the
same time. If we strive for the sum of probabilities to equal 1, then we end
up with the sum(P(x)) = 1, but P(x) is everywhere zero.

The countable additivity never enters into this, but for any uncountable set
of events a uniform distribution is impossible.

~~~
thaumasiotes
> I don't believe there is a uniform probability distribution over any
> interval of the reals.

Then I'll observe that you probably shouldn't be trying to comment on this
topic. I didn't just assert that there is one, I pointed out to you what it
was.

The probability density function f(x) = 1, defined over the interval [0,1], is
uniform (all values are equal, being 1) and covers an area of 1. That's all a
uniform distribution is.

It satisfies the axiom which I assume you're referring to as the "second axiom
of probability" in that the definite integral of the pdf over the entire
interval is 1. It satisfies the requirement you're confused about in that the
probability of choosing a number that falls into either of two disjoint
subintervals is equal to the sum of the probabilities of (1) choosing a number
falling into the first subinterval; + (2) choosing a number falling into the
second subinterval.

> Suppose such a distribution existed over [0, 1]. Then as we have shown
> before, the probability of choosing 0 <= x <= 1 is zero.

For fixed _x_ , the probability of choosing _x_ from a uniform distribution
over the reals is 0. That is a special case of the probability that a value
chosen from a uniform distribution over the reals will lie within an interval.
The probability of drawing a value from within the interval [ _a_ , _b_ ], for
any distribution, is the definite integral of the distribution's pdf from _a_
to _b_. As you can see, when _a_ = _b_ , this value is 0, but when _a_ ≠ _b_ ,
it isn't. The probability of choosing an _x_ such that 0 <= x <= 1 from a
uniform distribution over [0,1] is 1, not 0.

~~~
AaronFriel
Oh gosh, you're correct. It's been a while since I've done this (well).

~~~
gustavpaul
Much respect for confirming to the rest of us reading this thread that your
interlocutor's argument is the better one / yours is wrong. Having determined
the correct answer, we all walk away correct, regardless of who was corrected.

------
no_gravity
It might be interesting to calculate the 'primeness' of complex numbers and
then render the values as shades of grey on the complex plane.

Some years I did something similar for the 'divisibility' of prime numbers and
the result was pretty interesting:

[http://www.gibney.de/does_anybody_know_this_fractal](http://www.gibney.de/does_anybody_know_this_fractal)

The most common interpretation of a 'complex prime' is the gaussian prime.
When rendered on the complex plane looks like this:

[https://commons.wikimedia.org/wiki/File:Gauss-
primes-768x768...](https://commons.wikimedia.org/wiki/File:Gauss-
primes-768x768.png)

Looks rather random. Maybe going from 'is prime or not' to 'primeness' would
reveal some more insight.

------
d--b
I find it terrible naming. “Almost-x” is good but “2-almost-x” really sounds
bad. “2-factor number” ? “2nd-order-prime”? Twime, Thrime? Even “2-quasi-
prime” sounds better.

------
mangecoeur
Sub-prime :P

------
LarryMade2
I don't know what to apply it with yet, but as a programmer I can see this
will be useful information.

~~~
kijin
A lot of public key cryptography involves computing a very large number that
is a product of two prime numbers.

