OFFSET
0,1
LINKS
Jean-Marc Rebert, doubleDecomposition
Carlos Rivera, Puzzle 1077. These numbers that are..., The Prime Puzzles and Problems Connection.
EXAMPLE
a(0) = 2, because 2 = 2, and there is no smaller prime.
a(1) = 29, because 29 * 31 * 37 = 33263 = 11083 + 11087 + 11093, and there is no smaller prime that starts a run of 3 consecutive primes whose product is a sum of 3 consecutive primes.
a(2) = 293, because 293 * 307 * 311 * 313 * 317 = 2775683761181 = 555136752211 + 555136752221 + 555136752227 + 555136752251 + 555136752271, and there is no smaller prime that starts a run of 5 consecutive primes whose product is a sum of 5 consecutive primes.
Let y be the product of the 2n+1 consecutive primes starting with a(n) and let q be the first prime in the sum of 2n+1 consecutive primes. For n = 0..3 we have:
.
n 2n+1 a(n) y #dgts(y) q #dgts(q)
- ---- ---- ----------------- -------- ---------------- --------
0 1 2 2 1 2 1
1 3 29 33263 5 11083 5
2 5 293 2775683761181 13 555136752211 12
3 7 229 52139749485151463 17 7448535640735789 16
.
For more examples, see the "doubleDecomposition" link.
PROG
(Python)
from math import prod
from sympy import prime, nextprime, prevprime
def A352065(n):
plist = [prime(k) for k in range(1, 2*n+2)]
pd = prod(plist)
while True:
mlist = [nextprime(pd//(2*n+1)-1)]
for _ in range(n):
mlist = [prevprime(mlist[0])]+mlist+[nextprime(mlist[-1])]
if sum(mlist) <= pd:
while (s := sum(mlist)) <= pd:
if s == pd:
return plist[0]
mlist = mlist[1:]+[nextprime(mlist[-1])]
else:
while (s := sum(mlist)) >= pd:
if s == pd:
return plist[0]
mlist = [prevprime(mlist[0])]+mlist[:-1]
pd //= plist[0]
plist = plist[1:] + [nextprime(plist[-1])]
pd *= plist[-1] # Chai Wah Wu, Apr 21 2022
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Jean-Marc Rebert, Mar 05 2022
EXTENSIONS
a(15)-a(19) from Chai Wah Wu, Apr 21 2022
STATUS
approved