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”).

A351124
a(n) is the least k > 0 such that the set { prime(n), ..., prime(n+k-1) } can be partitioned into two disjoint sets with equal sum, or -1 if no such k exists (prime(n) denotes the n-th prime number).
1
3, 6, 4, 4, 4, 4, 8, 10, 4, 8, 8, 4, 10, 14, 6, 4, 6, 6, 8, 8, 4, 8, 12, 10, 4, 4, 4, 8, 4, 8, 6, 10, 4, 6, 8, 18, 4, 6, 8, 6, 4, 12, 4, 8, 10, 6, 10, 4, 8, 6, 8, 12, 10, 4, 6, 4, 8, 8, 10, 8, 12, 8, 4, 12, 6, 6, 8, 8, 14, 8, 4, 8, 10, 4, 10, 6, 4, 10, 8, 4, 4
OFFSET
1,1
COMMENTS
Conjecture: all terms are positive.
LINKS
FORMULA
a(n) = 4 iff n belongs to A022884.
EXAMPLE
The first terms, alongside an appropriate partition {P, Q}, are:
n a(n) P Q
-- ---- -------------------- --------------------
1 3 {2, 3} {5}
2 6 {3, 5, 7, 13} {11, 17}
3 4 {5, 13} {7, 11}
4 4 {7, 17} {11, 13}
5 4 {11, 19} {13, 17}
6 4 {13, 23} {17, 19}
7 8 {17, 29, 31, 43} {19, 23, 37, 41}
8 10 {19, 31, 41, 47, 53} {23, 29, 37, 43, 59}
9 4 {23, 37} {29, 31}
10 8 {29, 41, 47, 53} {31, 37, 43, 59}
PROG
(PARI) a(n) = { my (s=[0], k=0); forprime (p=prime(n), oo, s=setunion(apply (v -> v-p, s), apply (v -> v+p, s)); k++; if (setsearch(s, 0), return (k))) }
CROSSREFS
Cf. A022884.
Sequence in context: A308291 A006464 A233825 * A159354 A196500 A023676
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 02 2022
STATUS
approved