Find if a number is a possible sum of two or more numbers in a given set - python
<p>The office supply store sells your favorite types of pens in packages of 5, 8 or 24 pens. Thus, it is possible, for example, to buy exactly 13 pens (with one package of 5 and a second package of 8), but it is not possible to buy exactly 11 pens, since no non-negative integer combination of 5's, 8's and 24's add up to 11. To determine if it is possible to buy exactly n pens, one has to find non-negative integer values of a, b, and c such that</p>

<p>5a + 8b + 24c = n</p>

<p>Write a function, called numPens that takes one argument, n, and returns True if it is possible to buy a combination of 5, 8 and 24 pack units such that the total number of pens equals exactly n, and otherwise returns False.</p>

<p>Note: it was a question that came up in a mid sem exams, that was last month. i was unable to solve it but am still looking for the solution. any help will be accepted. the code in python or an algorithm to solve it. thanks</p>
