# 10A+9B+7C+3D+5E=229 and a,b,c,d,e can be whole numbers 1-10, How many Solutions?

#### coolo

##### New Member
If 10A+9B+7C+3D+5E=229 and a,b,c,d,e can be a whole numbers 1-10

How many possible solutions are there?

***I was thinking to break down into prime factors but this doesn't help as the numbers are added together. Thanks for the help!

#### katxt

##### Active Member
This is almost certainly done most quickly by writing a brute force program with 5 loops. 3 min for program, 2 sec for solution.

#### coolo

##### New Member
Thank you. Anyone with the programming knowledge necessary that can quickly help me with the solution?

#### katxt

##### Active Member
582 I assume you have Excel. Google how to get the developer tab up and create a macro, type or copy, then run it.
Sub count()
sol = 0
For a = 1 To 10: For b = 1 To 10: For c = 1 To 10: For d = 1 To 10: For e = 1 To 10
If 10 * a + 9 * b + 7 * c + 3 * d + 5 * e = 229 Then sol = sol + 1
Next: Next: Next: Next: Next
Range("a1") = sol
End Sub