OFFSET
1,1
COMMENTS
102 is the only known number n such that two numbers n!/2-(n+1) and n!/2+(n+1) are consecutive primes.
No other terms below 1000. - Max Alekseyev, Feb 14 2009
No other terms below 2500. - Michael S. Branicky, Sep 01 2024
LINKS
Carlos Rivera, Sum of k primes = Product of k integers, The Prime Puzzles and Problems Connection.
EXAMPLE
Representations as the sum of two consecutive primes: 4! = (4!/2-1) + (4!/2+1), 5! = (5!/2-1) + (5!/2+1), 27! = (27!/2-107) + (27!/2+107), 77! = (77!/2-397) + (77!/2+397), and 102! = (102!/2-103) + (102!/2+103).
MATHEMATICA
Get["NumberTheory`NumberTheoryFunctions`"];
Do[If[PreviousPrime[n!/2]+NextPrime[n!/2]==n!, Print[n]], {n, 700}]
s2cpQ[n_]:=Module[{c=n!}, c==NextPrime[c/2]+NextPrime[c/2, -1]]; Select[Range[ 110], s2cpQ] (* Harvey P. Dale, Mar 04 2023 *)
PROG
(PARI) is(k) = precprime(k!/2)+nextprime(k!/2) == k! && k>3; \\ Jinyuan Wang, May 30 2020
(Python)
from sympy import isprime, nextprime, prevprime
def ok(n):
if n <= 5: return n == 5
return not isprime(n//2) and n == prevprime(n//2) + nextprime(n//2)
def afind(limit):
factk = 1
for k in range(1, limit+1):
factk *= k
if ok(factk): print(k, end=", ")
afind(140) # Michael S. Branicky, May 27 2021
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Farideh Firoozbakht, Feb 07 2009
EXTENSIONS
Edited by Max Alekseyev, Feb 07 2011
STATUS
approved