Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hui's immediate response was, "Do you start counting from 0 or 1?"

Counting numbers are defined as the integers starting from one. I'm probably lacking a bit of rigour there. err ... Define 1 = S or is that S = 1 or S is a thing or 1 is a thing or something and then put more S (s) in until you run out of S (essessses) then you have reached infinity. If it's not a really big infinity then keep adding S (sssssss) or remove a few and add some more. You'll get there eventually - lots of Ss or infinity, or not, who knows? If you run out of S then try adding some T. Everything is better with T.

He would have better off with: "Do you prefer green trees or brown trees?" That would have simply sounded silly, rather than +1 insightful.



Yeah that comment didn’t make much sense. No one would seriously dispute that 2 is the first prime.


Because “not prime” isn’t the same as “composite” (1 is neither prime nor composite in the modern view) it isn’t that simple.

Some ancient mathematicians such as Aristotle and Plato solved that problem by saying 2 is the first number. Others stated 3 to be the first prime

That isn’t holdable once you accept 0 and negative integers to be numbers.

https://cs.uwaterloo.ca/journals/JIS/VOL15/Caldwell2/cald6.h... states that, for example, Goldbach thought 1 to be prime at some time (in a letter to Euler), as did Legendre, Lebesgue (sometimes), Cayley, Kronecker, Hardy, Lehmer (as the article discussed also says), and the aliens in Carl Sagan’s “Contact”.

It also gives fairly recent publications that state 1 is a prime.

In the end, whether we consider 1 to be prime is more a choice (just as mathematicians commonly chose to pick 0⁰ = 1) than that it necessarily the case. It just is the better choice (https://en.wikipedia.org/wiki/Prime_number#Primality_of_one)


We’re not talking about whether or not 1 is prime. We’re talking about whether 2 is the first prime or the zeroth prime.

No one would seriously say the latter.


Can there be a zeroth prime? We are counting things and I think that counting starts at one.

Given that a counting always starts at one, because that is what defines counting, then there cannot be a zeroth prime.


Well, technically, rigorously defined counting starts at 0, not at 1.

You can define counting as defining an injective function from your set to the natural numbers, and then you need to have some element going to 0 - as per the definition of a countable set[0].

Also, both the cardinal[1] and the ordinal[2] numbers are defined as starting from 0, just like the cardinal numbers.

[0] https://en.wikipedia.org/wiki/Countable_set

[1] https://en.wikipedia.org/wiki/Cardinal_number

[2] https://en.wikipedia.org/wiki/Ordinal_number


"Countable" is not the same as the "countable numbers" nor is it the same as the process of "counting".

The process of counting might be defined as what starts to happen when you stick up one finger and say something to emphasise what that finger means. That something will not be zero. Ever.

When you count your sheep into your pen, you will of course start: "Yan, tan, tither, toe" Trust me that yan does not mean zero.

Also note that if you search those terms, you will get a valid result and conclude I've misspelt some of those Cumbric words. I haven't, according to living relos of mine. Speling is a bit odd anyway when you go back a few centuries and I'll wager that tither is more likely than tethera because it is very slightly more easy to say. Tethera is three syllables but tether is two, bordering on one. However tethera could be pronounced "tethra", ie drop the extra e when spoken.

The counting numbers are fairly rigorously defined and are the numbers we use when we don't have access to more than the usual four dimensions, imaginary thingies, quaternions, etc etc.

The counting numbers start at one (probably)


> You can define counting as defining an injective function from your set to the natural numbers, and then you need to have some element going to 0 - as per the definition of a countable set[0].

You can define counting as an injection into other (equivalent) sets just as rigorously.

And it's not even universally agreed on that the natural numbers should include 0. Wikipedia mentions the different conventions: https://en.wikipedia.org/wiki/Natural_number

(I like my natural numbers to start with 0. But that's just because 0 is my second most favourite number. Starting with 1 is legitimate.)


That is exactly my point.


Do you have a reference for the claim about Plato and Aristotle? As far as I know, 2 being the first number was a fact of ordinary Greek.


Hui originally said "Do you start counting from 0 or 1" and I think he was taking the piss, as am I.

I'm not sure how we go to this point exactly but I've drunk a lot of wine and will now take stage left.


Context matters. Hui likely used APL to code up the problem and APL let's one choose between 0- and 1-indexing. Reading APL papers from around the time, it looks common to have explicitly declared your indexing convention up front, so my suspicion is that Hui essentially was responding "I'll code up a bit of APL and get you the answer. What are your conventions?"


Not so! Some, quite seriously, consider -1 to be prime. John Conway was such a person.


Lol check this out https://www.google.com/search?q=is+-1+prime

More seriously

http://mathforum.org/library/drmath/view/55958.html

But the link to details is dead.


Internet Archive suggests the original discussion was a Usenet thread; here is the link to Google Groups' version of it:

https://groups.google.com/d/topic/geometry.research/7pyFhAAy...


> Lol check this out https://www.google.com/search?q=is+-1+prime

I saw that, looking for references... very amusing. Even funnier (to me):

https://www.google.com/search?q=is+1000000101110000000000000...


-1 can't be prime because many things that use prime numbers require a positive number. For example, how would you define prime powers? (-1)^2=1...

You can certainly give a name to the integers {-1} U P, but maybe it would be better to call them "choice" or "select" numbers.


As John Conway said (see sibling comment, or e.g., [1]):

> Every nonzero rational number has a unique factorization into powers of distinct primes.

As you note, (-1)^2 = 1. But if you read carefully, you'll see that the factorization of -100/3 is uniquely:

  -1 * 4 * 1/3 * 5 * 1 ...
whereas the factorization of 100/3 is uniquely:

  1 * 4 * 1/3 * 5 * 1 ...
Where it's true that the representation using primes with exponents is not unique, it is true that the representation using powers of primes is unique. That is, your issue regarding (-1)^2 is that there are infinitely many representations of 1 or -1 having the form (-1)^x, but if you evaluate (-1)^x (x being integral, of course) you'll only get one of two numbers.

And yes, changing the definition of "prime" does change some special cases -- it removes some (such as extending unique factorization to negative rationals), and adds others (wherever primes are assumed positive).

[1] http://swc-alpha.math.arizona.edu/video/2009/2009ConwayLectu... (mention around 7:00)


Mr Conway was (RIP) a genius. If he says -1 is prime ... it's prime. End of.


That wasn’t in dispute. The question was whether you count 2 as the 0th or 1st prime.


Not true, 1 was considered prime quite recently https://blogs.scientificamerican.com/roots-of-unity/why-isnt...


Have you read GEB (Hofstadter)? I'm not an expert but I am capable of taking the piss. It should be pretty obvious.

SS


Lots of modern mathematical texts define counting from 0, and it might be brought up because of the engineering context of indexing convention in a language that lets you flexibly define that.

What defines counting is an initial element, often called 0, and a successor function which constructs the next number. The question is why you're doing such a construction, and if you want an identity element for natural addition.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: