How to solve an equation with unknown numeric operators in Wolfram Alpha?
75 ? 4 ? 10 ? 6 ? 2 ? 2 = 286
? are the basic numeric operators + - * /
With a bash shell, I can use the brace expansion to generate all combinations and use the basic calculator (bc) to evaluate it:
n=0
for i in 75{+,-,*,/}4{+,-,*,/}10{+,-,*,/}6{+,-,*,/}2{+,-,*,/}2; do
n=$((n+1))
j=$(echo $i | bc)
if [ $j -eq 286 ]; then
echo "Result is ${i}=${j} (${n} iterations)" | sed -r 's/([=+*\/-])/ \1 /g'
break
fi
done
The answer is
75 * 4 + 10 - 6 * 2 * 2 = 286
I understand this could be tricky to implement if you also permute all numbers.