SERVING THE QUANTITATIVE FINANCE COMMUNITY

katastrofa
Posts: 8137
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

How men invented useful problems.

Cuchulainn
Posts: 59932
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

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

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

neauveq
Posts: 10
Joined: May 28th, 2018, 10:25 pm

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

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.

katastrofa
Posts: 8137
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

You need to use the mathematics of quantum neutrino fields!

neauveq
Posts: 10
Joined: May 28th, 2018, 10:25 pm

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

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

Cuchulainn
Posts: 59932
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

katastrofa
Posts: 8137
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

All men. Wearing dresses, what?
Attachments

tagoma
Posts: 18259
Joined: February 21st, 2010, 12:58 pm

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

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

ISayMoo
Topic Author
Posts: 2050
Joined: September 30th, 2015, 8:30 pm

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

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

tagoma
Posts: 18259
Joined: February 21st, 2010, 12:58 pm

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

It's all right guys. It's OK not to know the answer.
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).
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?

ISayMoo
Topic Author
Posts: 2050
Joined: September 30th, 2015, 8:30 pm

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

bearish
Posts: 4968
Joined: February 3rd, 2011, 2:19 pm

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

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

katastrofa
Posts: 8137
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

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

Cuchulainn
Posts: 59932
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

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

katastrofa
Posts: 8137
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

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

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