OFFSET

3,6

LINKS

Lei Zhou, Table of n, a(n) for n = 3..79

EXAMPLE

n=4, 2n=8. There is only one set of primes {3,5} such that 6=3+3, 8=3+5. So a(4)=1.

...

n=8, 2n=16. We can find two sets, {3,5,7,11} and {3,5,7,13} that have such features. So a(8)=2. Here any set with more primes either contains an unused prime number or one of these two sets is a subset of them, like {3,5,7,11,13}, and thus is not considered. So a(8)=2.

...

n=13, 2n=26. Five such sets are found: {3,5,7,11,13}, {3,5,7,13,17},{3,5,7,13,19}, {3,5,7,11,17,19}, {3,5,7,11,17,23}. So a(13)=5.

MATHEMATICA

a = {{{3}}}; Table[n2 = 2*n; na = {}; la = Last[a]; lo = Length[la]; Do[ok = 0; Do[p1 = la[[i, j]]; p2 = n2 - p1; If[MemberQ[la[[i]], p2], ok = 1], {j, 1, Length[la[[i]]]}];

If[ok == 1, na = Sort[Append[na, la[[i]]]], Do[p1 = la[[i, j]]; p2 = n2 - p1; If[PrimeQ[p2], ng = Sort[Append[la[[i]], p2]]; big = 0; If[Length[na] > 0, Do[If[Intersection[na[[k]], ng] == na[[k]], big = 1], {k, 1, Length[na]}]]; If[big == 0, na = Sort[Append[na, ng]]]], {j, 1, Length[la[[i]]]}]], {i, 1, lo}]; AppendTo[a, na]; Length[na], {n, 4, 60}](* Program lists the 4th item and beyond *)

CROSSREFS

KEYWORD

nonn,hard

AUTHOR

Lei Zhou, May 02 2014

STATUS

approved