Post Reply 
[VA] SRC #008 - 2021 is here !
01-14-2021, 10:18 PM
Post: #37
RE: [VA] SRC #008 - 2021 is here !
Hi Valentin,
My bad ! I posted this using my phone, not realizing how bad the formatting would be.
I have deleted the original post.
Now that the challenge is over, please find below my original text without the code tags, for your kind consideration.

Many thanks and best regards,

Vincent

First, let's fix the number of numbers the sum is composed of.
Let's try the simplest case - 2 numbers. There are x and 2021-x.
The product is maximum when the derivative of x*(2021-x) is 0, so when 2021-x-x=0, or x=2021/2. This is not an integer, ok, but then I got the intuition that the product is maximized when the numbers are as close to each other as possible.
So let's try with 3 numbers. They are x,y,and (2021-x-y).
The product is maximized when both x and y partial derivatives are zero, so when 2021-2x-y=0 and 2021-x-2y=0. This simple system leads to x=y=2021/3. Again, non-integer, but confirms the intution that the numbers need to be equal !
So I was bald engouh to take this intuition for granted for any number of numbers Smile
So now, what this number of numbers should be ?
Well if x is this number, then 2021/x is each equal number contributing to the sum, and the product is (2021/x)^x, which is also equal to e^(x.ln(2021/x)).
Composition derivation leads to a derivative of
(ln(2021/x)+x.-2021/x^2*x/2021)*...= (Ln(2021/x)-1)*... ("..." being the original product function which is never going to be zero).

Which leads to an optimal number of numbers of x=2021/e = 743.48... non integer of course.So each number should ideally be equal to e=2.718... the closest integer that comes to mind is obviously 3. You can fit 673 times 3 in 2021. 3×673=2019, remains 2. As for the product, 3^673*2=2.53E321, which is, well, quite a lot Smile maybe not as much as you expected though , Valentin ? Smile
I could write a stupid brute force algorithm for the fast free42, trying every single possibility, but I am too lazy for that Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-02-2021, 01:49 AM
RE: [VA] SRC #008 - 2021 is here ! - robve - 01-03-2021, 06:33 PM
RE: [VA] SRC #008 - 2021 is here ! - robve - 01-05-2021, 03:39 AM
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-04-2021, 05:56 PM
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-04-2021, 07:24 PM
RE: [VA] SRC #008 - 2021 is here ! - Gene - 01-06-2021, 02:54 PM
RE: [VA] SRC #008 - 2021 is here ! - EdS2 - 01-08-2021, 01:32 PM
RE: [VA] SRC #008 - 2021 is here ! - Vincent Weber - 01-14-2021 10:18 PM



User(s) browsing this thread: 2 Guest(s)