Page 1 of 3

Get 24 from 1, 3, 4 and 6

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

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

Posted: June 15th, 2019, 12:26 pm
by katastrofa
You'll need (), too...

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

Posted: June 15th, 2019, 1:39 pm
by Collector
"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

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

Posted: June 15th, 2019, 4:41 pm
by Alan
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

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

Posted: June 15th, 2019, 4:49 pm
by ISayMoo
And using standard arithmetics?

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

Posted: June 15th, 2019, 4:56 pm
by Alan
Can the numbers be used more than once? 

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

Posted: June 15th, 2019, 5:31 pm
by Paul
"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.”

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

Posted: June 15th, 2019, 7:52 pm
by katastrofa
You need "(" and ")", too...

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

Posted: June 15th, 2019, 7:53 pm
by ISayMoo
You'll need (), too...
Yes, sorry. 

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

Posted: June 15th, 2019, 10:37 pm
by neauveq
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?

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

Posted: June 15th, 2019, 11:18 pm
by katastrofa
You need to use Deep Neural Networks.

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

Posted: June 16th, 2019, 3:33 am
by Alan
In Mathematica:

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

24

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

Posted: June 16th, 2019, 11:50 am
by Cuchulainn
In Mathematica:

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

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

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

Posted: June 16th, 2019, 11:21 pm
by Alan
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
:D

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

Posted: June 18th, 2019, 11:12 am
by Cuchulainn
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?