### Re: Get 24 from 1, 3, 4 and 6

Posted:

**June 18th, 2019, 11:59 am**How men invented

*useful*problems.SERVING THE QUANTITATIVE FINANCE COMMUNITY

https://forum.wilmott.com/

Page **2** of **3**

Posted: **June 18th, 2019, 11:59 am**

How men invented *useful* problems.

Posted: **June 19th, 2019, 8:36 am**

a/b == 0 hmmm.. Implementation-dependent.Write 24 using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers.Code: Select all`int main() { int a, b, c, d, answer; a = 1; b = 3; c = 4; d = 6; answer = a/b + c*d; printf("The answer is %d\n",answer); } // output: The answer is 24`

24 is a highly composite number, just like 5040. Coincidence?

Posted: **June 20th, 2019, 11:05 pm**

My guess is that such a solution is not possible if we are limited to +, -, /, * operations. I don't know enough Maths to prove or disprove this. As a newcomer to programming, I tried to have a crack at this in Python. I found 23, 23.(6), 24.(3), 25 but no 24.

Posted: **June 20th, 2019, 11:28 pm**

You need to use the mathematics of quantum neutrino fields!

Posted: **June 20th, 2019, 11:42 pm**

Hmm, what about the same problem but with numbers 8,6,7,5,3,0,9?

Posted: **June 22nd, 2019, 2:56 pm**

Posted: **June 22nd, 2019, 3:09 pm**

All men. Wearing dresses, what?

Posted: **June 22nd, 2019, 5:16 pm**

"or" in your post gets me somewhat confused. has one to use the 4 operators?Write 24 using 1, 3, 4 and 6 and +, -, *or/ operators. You have to use all 4 numbers.

Posted: **June 22nd, 2019, 10:38 pm**

It's all right guys. It's OK not to know the answer.

Posted: **June 23rd, 2019, 6:06 am**

my answer would be 6/(1-(3/4)) that i got by brute force, but i’m not sure whether you require the all 4 arithmetics operators to be used (game statement is ambiguous for non English-native).It's all right guys. It's OK not to know the answer.

you introduce a game but seem reluctant to be more specific on rules. why?

btw what is the starting point to get to a result using an elegant mathematical reasoning?

Posted: **June 23rd, 2019, 10:00 am**

Your answer is accepted.

Posted: **June 23rd, 2019, 12:38 pm**

The closest I could get was (1+4+3*6)++

Posted: **June 23rd, 2019, 1:43 pm**

I think (14-6)*3 is also an acceptable answer.

Posted: **June 23rd, 2019, 3:40 pm**

ISM is using you as guinea-pigs for a neurotic arithmetic experiment. It's like generating expressions.

Posted: **June 30th, 2019, 1:22 pm**

Arithmetics is dangerous. Easy to sprain an ankle when doing all the jumps.