login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A352065
a(n) is the least prime p that starts a run of 2n+1 consecutive primes whose product is a sum of the same number of (others or same) consecutive primes.
1
2, 29, 293, 229, 3119, 67, 18121, 59629, 10247, 15391, 5903, 24007, 11783, 39359, 21013, 104917, 38273, 61129, 23663, 2423
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
Sequence in context: A124301 A276196 A077023 * A101750 A160952 A088615
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