SERVING THE QUANTITATIVE FINANCE COMMUNITY

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

### 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.

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

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

You'll need (), too...

Collector
Posts: 4567
Joined: August 21st, 2001, 12:37 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."

AI solutions allowed?:

Alan
Posts: 10036
Joined: December 19th, 2001, 4:01 am
Location: California
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;
printf("The answer is %d\n",answer);
}
// output: The answer is 24

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

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

And using standard arithmetics?

Alan
Posts: 10036
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

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

Can the numbers be used more than once?

Paul
Posts: 10454
Joined: July 20th, 2001, 3:28 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."

AI solutions allowed?:

Screen Shot 2019-06-15 at 3.32.51 PM.png
It does say “write.”

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

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

You need "(" and ")", too...

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

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

You'll need (), too...
Yes, sorry.

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

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

I couldn't figure it out, I am sure it involves some clever use of distributivity...

At first, I decided to factor 24 into prime factors 2*2*2*3 = a*a*a*b = (a^3)*b (note in this case (a^3)*b = 2*(a^2)*b = (a^2 + a^2)*b
Listing out the numbers we have:
1 = e (multiplicative identity)
3 = b
4 = 2*2 = a^2 (note in this case a^2 = 2*a = a + a)
6 = a*b
I tried various different combinations but with no avail.
None of this really proves or disproves anything but maybe a step in the right direction?

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

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

You need to use Deep Neural Networks.

Alan
Posts: 10036
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

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

In Mathematica:

StringJoin[ToString[1*6/3], ToString[4]]

24

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

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

In Mathematica:

StringJoin[ToString[1*6/3], ToString[4]]

24
I would have concerns about the run-time efficiency. Do the strings use hashing?
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Alan
Posts: 10036
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

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

In Mathematica:

StringJoin[ToString[1*6/3], ToString[4]]

24
I would have concerns about the run-time efficiency. Do the strings use hashing?

answer = StringJoin[ToString[1*6/3], ToString[4]];
Hash[answer, "SHA256"]
87843000942654739416790862908851944946087349408853794374923081877917692795355
Hash["24", "SHA256"]
87843000942654739416790862908851944946087349408853794374923081877917692795355
Hash[answer, "SHA256"] == Hash["24", "SHA256"]
True

Cuchulainn
Posts: 61554
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.
What about a least-squares optimisation problem?

24 is a highly composite number, just like 5040. Coincidence?
Last edited by Cuchulainn on June 19th, 2019, 8:45 am, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 ABOUT WILMOTT

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...

 JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...

GZIP: On