The simple brute force approach would be this:
The general combination can be represented as
2A + 3B + 7C
where A, B and C are less or equal to 0 and no more then N/2, N/3 or N/7, where N is the required sum. Then you can list all the combinations in a triple nested loop and check up if each of them fit or not. This process is easy to optimize a bit, as once you found some combination or exceeded the sum, it would not make any sense to increment any of the factors. Also, think about proper ordering of those three loops.
This is the first thing which comes to mind.
—SA