OFFSET
1,1
COMMENTS
Conjecture: all terms are positive.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
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
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 02 2022
STATUS
approved