cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A352065 #72 Jan 14 2023 12:16:17
%S A352065 2,29,293,229,3119,67,18121,59629,10247,15391,5903,24007,11783,39359,
%T A352065 21013,104917,38273,61129,23663,2423
%N 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.
%H A352065 Jean-Marc Rebert, <a href="/A352065/a352065_2.txt">doubleDecomposition</a>
%H A352065 Carlos Rivera, <a href="https://www.primepuzzles.net/puzzles/puzz_1077.htm">Puzzle 1077. These numbers that are...</a>, The Prime Puzzles and Problems Connection.
%e A352065 a(0) = 2, because 2 = 2, and there is no smaller prime.
%e A352065 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.
%e A352065 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.
%e A352065 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:
%e A352065 .
%e A352065   n  2n+1  a(n)                  y  #dgts(y)                 q  #dgts(q)
%e A352065   -  ----  ----  -----------------  --------  ----------------  --------
%e A352065   0     1     2                  2         1                 2         1
%e A352065   1     3    29              33263         5             11083         5
%e A352065   2     5   293      2775683761181        13      555136752211        12
%e A352065   3     7   229  52139749485151463        17  7448535640735789        16
%e A352065 .
%e A352065 For more examples, see the "doubleDecomposition" link.
%o A352065 (Python)
%o A352065 from math import prod
%o A352065 from sympy import prime, nextprime, prevprime
%o A352065 def A352065(n):
%o A352065     plist = [prime(k) for k in range(1,2*n+2)]
%o A352065     pd = prod(plist)
%o A352065     while True:
%o A352065         mlist = [nextprime(pd//(2*n+1)-1)]
%o A352065         for _ in range(n):
%o A352065             mlist = [prevprime(mlist[0])]+mlist+[nextprime(mlist[-1])]
%o A352065         if sum(mlist) <= pd:
%o A352065             while (s := sum(mlist)) <= pd:
%o A352065                 if s == pd:
%o A352065                     return plist[0]
%o A352065                 mlist = mlist[1:]+[nextprime(mlist[-1])]
%o A352065         else:
%o A352065             while (s := sum(mlist)) >= pd:
%o A352065                 if s == pd:
%o A352065                     return plist[0]
%o A352065                 mlist = [prevprime(mlist[0])]+mlist[:-1]
%o A352065         pd //= plist[0]
%o A352065         plist = plist[1:] + [nextprime(plist[-1])]
%o A352065         pd *= plist[-1] # _Chai Wah Wu_, Apr 21 2022
%Y A352065 Cf. A203619, A323052.
%K A352065 nonn,hard,more
%O A352065 0,1
%A A352065 _Jean-Marc Rebert_, Mar 05 2022
%E A352065 a(15)-a(19) from _Chai Wah Wu_, Apr 21 2022