# What is a combination of the numbers 1, 2, 3, 4, and 5 that yield 170, using only basic operations (+, -, *, /, ^) and the factorial (!)?

Rules:

1. Only basic operations (+, -, *, /, ^) and the factorial (!) are allowed.
2. No concatenation (i.e. 34, 12, 125, etc).
3. Parentheses are allowed.
4. All numbers must be used (omitting numbers is not allowed).
5. Each number can be used only once (i.e no $$2^2$$ or $$3+3$$ or $$5! * 5$$ or anything like that)

Examples: $$(1+2)^3 + 4! + 5! = 171$$ or $$(-1+2)*(3!+4!)*5 = 150$$

I know this is an oddly specific question, but I'm asking this question on behalf of someone else who is trying to make as many positive integers as possible using these rules. 170 is the only 'gap' they have on their spreadsheet at the moment, and I'd like to help them resolve it. We'd appreciate any assistance, and I apologize in advance if this question doesn't meet the guidelines of MSE.

EDIT: If it is not possible to construct a combination that yields 170, is there a way to prove it?

EDIT #2: I want to apologize. It turns out I missed a rule. It is now written below.

1. The numbers must in ascending order. (i.e. 1 before 2, 2 before 3, etc).
• Can be done in descending order $170 = (5 - 4! + 3!) ^ 2 + 1$, or in ascending if you read the exponent first $170 = (1 + 3 ^ 2 + 4!) \times 5$. Aug 4, 2023 at 12:53

(Posted before the OP's second edit.) $$170 = 5! + ((3! \times 4) + 1)\times 2.$$

• I apologize, I made a mistake. There was one more rule I neglected to add. I've now edited the post to include that rule. Still, thank you for the answer!
– ING
Aug 1, 2023 at 16:23

While I can't prove it for sure, empirical evidence seems to suggest that it's impossible. I have written a little brute forcing program in order to speed things up a little, and while it can almost instantly find solutions for all numbers up to 169, it gets stuck while trying to find a solution for 170.

I was curious though how well one could at least hope to approximate 170. The best solution it could find was:

-((1+2)!)!/(3/4-5) ≈ 169.4118


Now if we also allow the factorial to take any real number as an input (excluding negative integers), which we can achieve by extending its domain using the gamma function, it was able to find this:

-(-(((-((-(((-(-1/2)!)!)!)-3!)!)-4)!/5!)!)!)! ≈ 170.00000586


And here is a LaTeX version of it, to make it just a little more readable: $$-\left(-\left(\frac{\left(-\left(\left(-\left(\left(\left(-\left(-\frac12\right)!\right)!\right)!\right)-3!\right)!\right)-4\right)!}{5!}!\right)!\right)!$$

• Thank you for your answer! While I'm a bit disappointed that it seems like 170 can't be constructed, I can't say I'm surprised. If you don't mind, could you share your program with me? I'm fairly interested in learning how you made a computer perform a "brute force" search, especially given the nature of my question (essentially guessing at random what operations would yield 170).
– ING
Aug 4, 2023 at 6:31