I think that I get 18,432 permutations.

There are 4 possible places for operators ie.

Operator*number*operator*number*operator*number*operator*number

The first operator can only take on the value + or - but the other 4 can take on all 4 values. So we have 128 operator permutations.

The parenthesis generate another 6 permutations. Although this number could go higher if one considers (1+2+3+4) to be different from 1+2+3+4 or if (1)+(2)+(3)+(4) is considered to be different from 1+2+3+4.

Finally, then one can rotate the 4 numbers in the 4 positions which gives another 24 permutations.

Thus 128*6*24=18,432

I don't obviously see a way to get a solution that doesn't use brut force. I also not sure limiting the number of solutions that are desired influences the size of the code. The code must potentially search all permutations to ensure that no solutions exist. In fact, requiring only 1 soultion might increase the size of the code.

Just some thoughts.

PS. Maybe the general forum might be a better place for this competition.

[ 15. September 2002, 19:22: Message edited by: Jack Lothian ]
_________________________
Jack