Indeed, there is a story about backtracking, etc.
Let's just go with a bit more complex example:
The value we want to reach is 11, and the array is [5,4,8,2,3,6]
Here is one of the possible algorithms:
We will list all the way we find to reach every possible number lesser than or equal to 11 (I won't talk about the structure we use or anything, because I am just explaining the algorithm, not its implementation).
We will start with nothing, and add consider one new number at a time. In this algorithm, I will consider every number in the array is positive, so I won't keep track of reaching numbers higher than the number we want to reach.
So at the beginning we have nothing.
We introduce our first number : 5
We so have one way to reach 5, and it is 5 (or 5+0 if you prefer)
We introduce our second number : 4
The number we can now reach are:
4:{4}
5:{5}
9:{4+5}
We introduce our third number : 8
The number we can now reach are:
4:{4}
5:{5}
8:{8}
9:{4+5}
Nothing more because 8+4 > 11
We introduce our forth number : 2
The number we can now reach are:
2:{2}
4:{4}
5:{5}
6:{4+2}
7:{5+2}
8:{8}
9:{4+5}
10:{8+2}
11:{4+5+2}
We introduce our fifth number : 3
The number we can now reach are:
2:{2}
3:{3}
4:{4}
5:{5 ; 2+3}
6:{4+2}
7:{5+2 ; 4+3}
8:{8 ; 5+3}
9:{4+5 ; 4+2+3}
10:{8+2 ; 5+2+3}
11:{4+5+2 ; 8+3}
We introduce our sixth number : 6
The number we can now reach are:
2:{2}
3:{3}
4:{4}
5:{5 ; 2+3}
6:{4+2 ; 6}
7:{5+2 ; 4+3}
8:{8 ; 5+3 ; 2+6}
9:{4+5 ; 4+2+3 ; 3+6}
10:{8+2 ; 5+2+3 ; 4+6}
11:{4+5+2 ; 8+3 ; 5+6 ; 2+3+6}
Conclusion : there are 4 ways to make 11 : 4+5+2 ; 8+3 ; 5+6 and 2+3+6