News for hackers. Stuff that matters.
Re:7 is the largest prime followed by a cubic number by montenegrohugo on Monday September 03, 2018 @05:38AM (#17901512)
Math is funny. There's an infinite amount of primes, and even though we know a lot of them there's still more left (read:infinite). But at the same time, with high-school level algebra we can prove that the largest prime followed by a cubic number is 7.

The proof is really simple, but the fact is quite unintuitive (at least for me).

Re:7 is the largest prime followed by a cubic number by tetha on Monday September 03, 2018 @04:59PM (#17904835)
That is number theory. Number theory is at the same time extremely profound and very very blunt.

Every prime is double of an integer + 1, except for 2. This follows because primes are integers, integers are either 2 times n or 2 times n+1 and numbers representable as 2 times n have 2 as a prime factor, if n > 1. Hence, except for 2.

Overall, number theory is one example to me how very, very simple concepts are actually hard - because you're not trained to look for them. The proof is just ... obvious once pointed out. But why would you look for it with such simple manners?

Re:7 is the largest prime followed by a cubic number by Tomminn on Monday September 03, 2018 @06:02PM (#17905174)
Huh, I never realized this was this simple. Fleshing out the general case the post mentions.

Suppose p=x^n-1 is prime.

Note that:

  x^n - 1  = (x^n + x^(n-1) +... + x^2 + x) 
            -(      x^(n-1) +... + x^2 + x +1)

  =>x^n-1  = (x^(n-1) + x^(n-2) + ... + x + 1)(x-1)
So if p=x^n-1 is prime, one of the factors must be equal to 1. If the first factor is 1, this implies x=0 and so the second factor is -1. Therefore the second factor must be 1, and x=2.

Therefore if x^n-1 is prime, x must be 2. Damn that's cool. At first I thought any number 2^n-1 would be prime, but then I realized that obviously the left hand factor can have subfactors. Which is to say I remembered 15 exists.

Re:7 is the largest prime followed by a cubic number by jpegslayer on Monday September 03, 2018 @06:09PM (#17905200)
What about for n=4? I think the issue is that you're supposing that 2^n-1 is already prime.

Primes of this form are called Mersenne primes if you want more information on them.

Re:7 is the largest prime followed by a cubic number by Tomminn on Monday September 03, 2018 @06:11PM (#17905209)
See update, I realized my facepalm at roughly the same time as you:)
Re:7 is the largest prime followed by a cubic number by bwasti on Monday September 03, 2018 @06:26PM (#17905287)
not only that, but if p is prime and p = 2^n-1 then n is also prime

proof: https://jott.live/texdown/mersenne

Re:7 is the largest prime followed by a cubic number by tejtm on Tuesday September 04, 2018 @02:05AM (#17906945)
> if p is prime and p = 2^n-1 then n is also prime

for clarity p = (2^n)-1

Re:7 is the largest prime followed by a cubic number by BennyH26 on Monday September 03, 2018 @03:12PM (#17904350)
The proof states: "For n to be prime either x² + x + 1 = 1 or x - 1 = 1"

Could somebody tell me why each of the factor components must be equal to one?

Re:7 is the largest prime followed by a cubic number by gizmo686 on Monday September 03, 2018 @03:16PM (#17904367)
I believe there is a typo, and it should say "for p to be prime".

Since p = (x^2 + x + 1)(x - 1), and both of those factors are integers, if both factors were not 1, then we would have demonstrated a factoring of p; therefore p would be composite.

If you wanted to be super formal, you would have to deal with the possibility that the factors were -1, but that is more of an uninteresting technicality.

Re:7 is the largest prime followed by a cubic number by BennyH26 on Monday September 03, 2018 @03:32PM (#17904442)
Much appreciated, thank you
Re:7 is the largest prime followed by a cubic number by bwasti on Monday September 03, 2018 @03:26PM (#17904421)
ah good catch on the typo, just fixed it
Re:7 is the largest prime followed by a cubic number by amluto on Monday September 03, 2018 @04:00PM (#17904570)
There’s another minor error. The proof states:

> For $ p $ to be prime either $ x^2 + x + 1 = 1 $ or $ x - 1 = 1 $.

That’s not quite true. In general, if p is prime and p=a·b for integers a and b, then at least one of a and b is 1 or -1. The rest of the proof still works since, as you say, x != 0, so x + 1 != -1.

Re:7 is the largest prime followed by a cubic number by bwasti on Monday September 03, 2018 @04:26PM (#17904701)
I'll leave that omitted to keep things concise. I think it is quite common to assume a domain of natural numbers when talking about primes.

> then at least one of a and b is 1 or -1

I think you mean exactly one of a and b is 1 or -1

Re:7 is the largest prime followed by a cubic number by amluto on Monday September 03, 2018 @05:15PM (#17904921)
You can’t just assume a range of natural numbers in this context. You have a prime p that is equal to f(x) for some polynomial f with integer coefficients and some integer x. You observe that f(x)=a(x)b(x) where a and b are also polynomials with integer coefficients. It does not follow that a and b are non-negative. As an example, let f(x)=x^3-2x^2-3x+6. Then a(x)=x-2 and b(x)=x^2-3. Now you could try to argue that, if f(x) is prime, then one of a(x) and b(x) is 1, so x is 2 or 3, but f(2)=0 and f(3)=6, so f(x) can’t be prime for integer x. But you would be wrong, and, indeed, f(1)=2, which is prime.

You really do have to consider negative factors.

Re:7 is the largest prime followed by a cubic number by bwasti on Tuesday September 04, 2018 @12:39AM (#17906697)
that's a great counter example! updated the post
Re:7 is the largest prime followed by a cubic number by jwilk on Tuesday September 04, 2018 @03:01AM (#17907145)
You linked to the reply URL, which works only for logged-in users. Please consider using this instead:

https://news.ycombinator.com/item?id=17904921

Re:7 is the largest prime followed by a cubic number by bwasti on Tuesday September 04, 2018 @03:21AM (#17907210)
done
Re:7 is the largest prime followed by a cubic number by frankmcsherry on Monday September 03, 2018 @04:56PM (#17904822)
To be pedantic, shouldn't you also need to rule out the possibility that x is a negative number? For example, x = -1 satisfies your quadratic equation, but because we are doing an odd power of x you can rule it out.
Re:7 is the largest prime followed by a cubic number by amluto on Monday September 03, 2018 @09:36PM (#17906017)
Aside from the 1 vs -1 issue, the proof finds all integers x such that p is prime. So I think it’s fine.
Re:7 is the largest prime followed by a cubic number by rubatuga on Monday September 03, 2018 @03:14PM (#17904363)
Definition of a prime. Only divisible by itself and one
Re:7 is the largest prime followed by a cubic number by kowdermeister on Monday September 03, 2018 @03:55PM (#17904540)
What's the deal with all these $ symbols?
Re:7 is the largest prime followed by a cubic number by jmgao on Monday September 03, 2018 @03:58PM (#17904561)
It's TeX and you have Javascript off.
Re:7 is the largest prime followed by a cubic number by johnsonjo on Monday September 03, 2018 @07:00PM (#17905420)
If all else fails you might be able to use this MathJax bookmarklet that’s used on the stackexchange chat http://www.math.ucla.edu/~robjohn/math/mathjax.html.
Re:7 is the largest prime followed by a cubic number by bwasti on Monday September 03, 2018 @03:58PM (#17904559)
Assuming you have JavaScript disabled, that is latex notation.
Re:7 is the largest prime followed by a cubic number by huhtenberg on Monday September 03, 2018 @05:09PM (#17904882)
I'm too seeing raw $ markup. Nothing's blocked, no console errors, but there's a "425 No Reason Phrase" response for https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax..., not sure if it's relevant. That's in recent Firefox.

More specifically, when I open the page by clicking on the HN link or copy-pasting the URL into the bar and pressing Enter, the page renders OK. If I am to reload the page with Ctrl-R after that, it shows up in raw $ markup and no amount of refreshing helps. Furthermore, full reload (via Ctrl-Refresh) yields that 425 response.

Just FYI.

Re:7 is the largest prime followed by a cubic number by bwasti on Monday September 03, 2018 @08:07PM (#17905673)
thanks for the heads up. The site is self-hosting mathjax now
Re:7 is the largest prime followed by a cubic number by kowdermeister on Monday September 03, 2018 @04:15PM (#17904641)
I have not disabled JS, no console errors and all privacy extensions are turned off.

edit: it's loaded now just fine, odd.