With the given numbers I need to make:
$7 \circ 8 \circ 7 \circ 7 \circ 8 \circ 3 = 100$
Using only the following operators:
$+\space-\space\times\space\div$
Puzzling Stack Exchange is a question and answer site for those who create, solve, and study puzzles. It only takes a minute to sign up.
Sign up to join this communityWith the given numbers I need to make:
$7 \circ 8 \circ 7 \circ 7 \circ 8 \circ 3 = 100$
Using only the following operators:
$+\space-\space\times\space\div$
$7 \times 8 + 7 \times 7 - 8 + 3 = 100$
General "Countdown" arithmetic puzzle solution !!
Some Unix Shells have a property called 'brace expansion'
The usage varies between csh and bash but is something like this:
echo {a,i}{s,t}
Outputs:
as at is it
This can be used to solve the "Countdown" letters puzzle, simply have 9 consecutive braces with all 9 letters in each. If you don't know Countdown, you can use this to find Scrabble™ words, if you add a final brace at the end like {'\n'} you even get one result per line so you can pipe output through sort or usr/dict
So how do we do the Arithmetic puzzle ?
If we are given the integers 2,4,5
Alternate braces containing integers and operators:
set array {2,4,5}{+,-,\*,/}{2,4,5}…{'\n'} # * escaped to avoid wildcard
This gives:
2+2-4…
2-3*4…
Every permutation of integer and operator. Finally,
foreach s in (array) {echo $s ; eval $s} | sort
Evaluates all the expressions and even sorts them so you can find the integer you are looking for and the expression which created it.
"Countdown"™ Solved !!!