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

Posted:

**June 12th, 2019, 10:03 pm**Write 24 using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers.

SERVING THE QUANTITATIVE FINANCE COMMUNITY

https://forum.wilmott.com/

Page **1** of **3**

Posted: **June 12th, 2019, 10:03 pm**

Write 24 using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers.

Posted: **June 15th, 2019, 12:26 pm**

You'll need (), too...

Posted: **June 15th, 2019, 1:39 pm**

"**Write 24** using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers."

AI solutions allowed?:

AI solutions allowed?:

Posted: **June 15th, 2019, 4:41 pm**

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
```

Posted: **June 15th, 2019, 4:49 pm**

And using standard arithmetics?

Posted: **June 15th, 2019, 4:56 pm**

Can the numbers be used more than once?

Posted: **June 15th, 2019, 5:31 pm**

It does say “write.”"Write 24using 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

Posted: **June 15th, 2019, 7:52 pm**

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

Posted: **June 15th, 2019, 7:53 pm**

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

Posted: **June 15th, 2019, 10:37 pm**

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?

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?

Posted: **June 15th, 2019, 11:18 pm**

You need to use Deep Neural Networks.

Posted: **June 16th, 2019, 3:33 am**

In Mathematica:

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

24

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

24

Posted: **June 16th, 2019, 11:50 am**

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

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

24

Posted: **June 16th, 2019, 11:21 pm**

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

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

24

answer = StringJoin[ToString[1*6/3], ToString[4]];

Hash[answer, "SHA256"]

87843000942654739416790862908851944946087349408853794374923081877917692795355

Hash["24", "SHA256"]

87843000942654739416790862908851944946087349408853794374923081877917692795355

Hash[answer, "SHA256"] == Hash["24", "SHA256"]

True

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

What about a least-squares optimisation problem?Write 24 using 1, 3, 4 and 6 and +, -, * or / operators. You have to use all 4 numbers.

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