Q:

Algorithm that finds unique numbers that equal N(or an inputed number)

language agnostic question but I wanted to know if anyone can provide guidance logically on how to create a set that through adding or subtracting could generate any number between 1 and N.

A:

An idea.
If we used only summation, then the set consisting of powers of 2 less or equal than N would be such a minimal set. With subtraction, the powers of 3 seems to be an idea good enough for start. I suspect it may be minimal but don't have a proof.
My reasoning is the following. Suppose we have k numbers in the set. Then there are at most 3^k possible results we can get with summation and subtraction. (Note that those results contain negative integers. In fact, such a set of results is symmetric with respect to 0. And, usually, we'll get fewer than 3^k different results - some of them will simply repeat).
An example of "optimal" choice:
Let's take the first number equal to 1. Then the possible results are: -1, 0, 1. Next, take 3 - then we'll get all integers between -4 and 4. (Choice of number 2, instead of 3, is clearly inefficient.) Then, to obtain the next contiguous (and non-overlapping) sequence of integers we should take 9. And so on, until number N is reached.
We could use other numbers instead of powers of 3. In such a case, we should take care of gaps that will results in consecutive steps. And I doubt it would produce a set with fewer elements. (I may be wrong, though.)

