News for hackers. Stuff that matters.
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