I'm sure there is only one way to add any of those numbers to 18...
If instead what you are looking for is an equation representing a sum of 18 obtained from the set of five numbers you listed, that is an entirely different issue. (In mathematics context is everything).
There are 307 ways to add the following 5 numbers to 18. ( 2, 3, 6, 7, 8). Looking for the equation used to find this answer.
Call me crazy, but
A: I dont think you could figure that out using any kind of simple mathematical "formula" or equation, and
B: Your question is not really properly phrazed, since there is no mathematical way possible you could find 307 ways to ADD those numbers together to result in an answer of 18. You would have to also be able to subtract them, devide them or multiply them in various combinations as well in order to approach 307 possible combinations. Unless you are talking about simply adding the numbers in question TO 18 (Ie, 18+2, 18+3, 18+6+8, etc) in all assorted variations. In which case, that might be a bit easier to figure out.