login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A153429 Numbers k such that k! is equal to the sum of two consecutive primes. 0
4, 5, 27, 77, 102 (list; graph; refs; listen; history; text; internal format)
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
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
Cf. A000142.
Sequence in context: A056200 A282690 A282687 * A270217 A270274 A271602
KEYWORD
nonn,hard,more
AUTHOR
Farideh Firoozbakht, Feb 07 2009
EXTENSIONS
Edited by Max Alekseyev, Feb 07 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)