Andreas Enge on Thu, 28 Aug 2025 14:06:46 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: PARI/GP wrong on 7!!+7+1 being not prime, or oeis.org/Mathematica?


Hello,

Am Thu, Aug 28, 2025 at 01:48:53PM +0200 schrieb hermann@stamm-wilbrandt.de:
> The sequence is:
> https://oeis.org/search?q=5%2c7%2c13%2c113%20id:A118743
> 
> Bottom output for n up to 250 is returned immediately, for up to 1250 takes
> 3 seconds.
> 
> On fast AMD 7950X CPU with 5.6GHz boost frequency up to 12 takes minutes
> But more importantly, 7!!+7+1 is not reported as prime.
> Is 7!!+7+1 prime or not?

it depends on your definition... I did not know !!; for me it was the
factorial applied twice.
Then 7! = 1*2*…*7=5040 and 7!! = 5040!; (almost) all factorials are even,
so n!! + n+1 is never prime for n>=3 odd.

The OEIS definition seems to be that n! is the product of all odd numbers
up to n if n is odd, or all even numbers up to n if n is even; this is much
smaller.

PARI/GP uses the first definition, so (7!)!+7+1 is not prime.
7*5*3*1 + 7+1 = 113 is prime.

Andreas