# Make numbers 1-31 with 1,9,7,8

I am stuck with some of the solutions. These are rules:

• Use all four digits exactly once
• Allowed operations: +, -, x, ÷, ! (factorial), exponentiation, square root, squaring, parentheses

Thank you for the help :)

Found all almost all all of them (26 was fixed again):

$1 = \sqrt{9}+7-8-1$
$2 = \sqrt{9}+7-8*1$
$3 = \sqrt{9}+7-8+1$
$4 = \sqrt{9}+8-7*1$
$5 = 8+7-9-1$
$6 = 8+7-9*1$
$7 = (1^8)^9*7$
$8 = (1^7)^9*8$
$9 = (1^7)^8*9$
$10= 9+8-7*1$
$11= 9+8-7+1$
$12= 8+7-\sqrt{9}*1$
$13= 8+7-\sqrt{9}+1$
$14= 7*(9-8+1)$
$15= (9-7)*8-1$
$16= (9-7)*8*1$
$17= (9-7)*8+1$
$18= \sqrt{9}+8+7*1$
$19= \sqrt{9}+8+7+1$
$20= 7+8+\sqrt{9}!-1$
$21= 7+8+\sqrt{9}!*1$
$22= 7+8+\sqrt{9}!+1$
$23= 7+8+9-1$
$24= 7+8+9*1$
$25= 7+8+9+1$
$26= \sqrt{9}*(7-1)+8$
$27= \sqrt{9}*(8!/7!+1)$
$28= \sqrt{9}*7+8-1$
$29= \sqrt{9}*7+8*1$
$30= \sqrt{9}*7+8+1$
$31= \sqrt{9}*8+7*1$

I made pretty heavy use of $\sqrt{9}=3$, as well in certain cases of $1^x=1$ and $x!/(x-1)!=x$. Additionally, wherever I have a formula for $x$ with $-1$ at the end of the formula, $x+1$ and $x+2$ are easily obtained by using $*1$ and $+1$ respectively.

It should be noted that some expressions might not be in the simplest form. For some simply because I found the one listed earlier, for others (mainly 7, 8 and 9 - these can be done with simple addition and subtraction) because I liked this solution better.

• shoudn't 2=(√3+7−8)∗1 (and similar usage) because without the brackets 8*1 comes before additions and soustractions ? – dna Nov 30 '17 at 10:50
• It indeed comes first, but it doesn't matter. Right now it's doing 3+7=10, 8*1=8, 10-8 is 2. Your version is doing 3+7=10, 10-8=2, 2*1=2. Basically, the *1 is a no-operation, and it doesn't matter where in the equation you insert a no-operation. I guess you could also say, it doesn't matter where in the equation you don't insert an operation. – Lolgast Nov 30 '17 at 10:56
• brute force solver says 26 is impossible using only +, -, *, and /, so it's time to bring out the big guns. – Bass Nov 30 '17 at 11:24