Say I have the following formula

```
a + (13 * (b/c)) + d + (12 * e) - f - 11 + (g * (h/i)) - 10 = 66;

```

Now the letters a-i can represent a number from 1-9. However, each number can only be used once. What would be the most efficient way to solve this? The way I have at the moment is to generate an array of random numbers e.g.

```
array[2,5,1,7,8,6,9,3,4]

```

I then fit this into the formula to check if it equals 66. If not, I generate a new array of numbers. I was thinking there should be a better way to do this though, maybe using recursion?

Just wanted to get some input in how you would tackle this?

Thanks