%I #7 Feb 11 2022 09:33:00
%S 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,
%T 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,
%U 8,4,12,6,6,8,8,14,8,4,8,10,4,10,6,4,10,8,4,4
%N 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).
%C Conjecture: all terms are positive.
%H Alois P. Heinz, <a href="/A351124/b351124.txt">Table of n, a(n) for n = 1..20000</a>
%F a(n) = 4 iff n belongs to A022884.
%e The first terms, alongside an appropriate partition {P, Q}, are:
%e n a(n) P Q
%e -- ---- -------------------- --------------------
%e 1 3 {2, 3} {5}
%e 2 6 {3, 5, 7, 13} {11, 17}
%e 3 4 {5, 13} {7, 11}
%e 4 4 {7, 17} {11, 13}
%e 5 4 {11, 19} {13, 17}
%e 6 4 {13, 23} {17, 19}
%e 7 8 {17, 29, 31, 43} {19, 23, 37, 41}
%e 8 10 {19, 31, 41, 47, 53} {23, 29, 37, 43, 59}
%e 9 4 {23, 37} {29, 31}
%e 10 8 {29, 41, 47, 53} {31, 37, 43, 59}
%o (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))) }
%Y Cf. A022884.
%K nonn
%O 1,1
%A _Rémy Sigrist_, Feb 02 2022
|