Given a positive integer N, I want to create a set of positive integers such that any even number $4,6,8,...N$ can be written as the sum of two elements in the set. I also want the set to be as small as possible.
For example, with $N=24$, the set {${2,4,8,10,14}$} is one possible result. The set has $5$ elements, and no set with fewer elements has the desired property.
4=2+2
6=2+4
8=4+4
10=2+8
12=2+10=4+8
14=4+10
16=2+14=8+8
18=4+14=8+10
20=10+10
22=8+14
24=10+14
This example was found by hand. Is there a faster, more "mathematical" way?
This question is related to a challenge I created at codegolf.SE. I decided that the underlying mathematics was pretty interesting and that I wanted to learn more about it.