[VA] SRC #008 - 2021 is here !
|
01-02-2021, 12:57 AM
(This post was last modified: 01-05-2021 06:31 PM by Valentin Albillo.)
Post: #1
|
|||
|
|||
[VA] SRC #008 - 2021 is here !
... and what better way to welcome 2021 than a little 2021-themed SRC ? Welcome to my SRC #008 - 2021 is here !, a small nice one to commemorate 2021's arrival. See if you can deliver using your HP calculator, physical or emulated.
That said, try your HP-hand with these three: 1) Let's partition 2021 into a set of positive integer numbers that add up to 2021. Find the set of such numbers whose product is maximum, and output that maximum in all its full glory. For instance, we could have 2021 = 1 + 1 + ... + 1 (2021 1's) and their product would be 1 x 1 x ... x 1 = 1, which doesn't quite cut it. We could also have 2021 = 137 + 682 + 1202 and their product would be 137 x 682 x 1202 = 112307668, which is much better but still far from the maximum as well. 2) Numerically evaluate as accurately as possible this nice definite integral using your favorite HP calc (per standard notation, the | ... | vertical bars mean "absolute value"): ![]() and for extra points, see if you can symbolically recognize the resulting value. You'll need a sufficiently accurate value to do it, though ... ![]() 3) It is trivially easy to express the fraction 4/2021 as the sum of 4 numbers of the form 1/N where N is a positive integer, namely: 4/2021 = 1/2021 + 1/2021 + 1/2021 + 1/2021 See if you can do it with just 3 such numbers. My own solutions and comments in a few days.
P.S.: Edited to include a third case, see post #21 below. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
01-02-2021, 01:49 AM
Post: #2
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Happy New Year Valentin!
My idea for #1 came after a few minutes thought. I will wait a bit to post it, but it came without an HP being used - no cheating either. I will verify that my thoughts work with an HP, but ... Gene |
|||
01-02-2021, 05:42 AM
(This post was last modified: 01-02-2021 05:42 AM by RMollov.)
Post: #3
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
#1 is interesting for me and I think I know the answer even though I can't prove it. Furthermore I'm really curious how much a calculator helps in this case; there must be some theoretical mathematical basis under and not calculations.
Thanks |
|||
01-02-2021, 04:09 PM
(This post was last modified: 01-02-2021 07:39 PM by Nihotte(lma).)
Post: #4
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
(01-02-2021 12:57 AM)Valentin Albillo Wrote: Thanks for the challenge Valentin Albillo ! Code:
|
|||
01-02-2021, 09:24 PM
(This post was last modified: 01-02-2021 09:26 PM by J-F Garnier.)
Post: #5
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Hi Valentin,
Thanks for this nice New Year present ! I was inspired by your 2nd problem: (01-02-2021 12:57 AM)Valentin Albillo Wrote: 2) Numerically evaluate as accurately as possible this nice definite integral using your favorite HP calc (per standard notation, the | ... | vertical bars mean "absolute value"): I had no special problem to evaluate it on the HP-71 (actually Emu71:-) with the Math ROM, after a simple operation. Quote:and for extra points, see if you can symbolically recognize the resulting value. You'll need a sufficiently accurate value to do it, though ... Using your great "Identifying Constants" program, I found the symbolic value, a nice surprise, that lead me to another conclusion about the expression to integrate :-) Thanks again, J-F |
|||
01-03-2021, 06:33 PM
(This post was last modified: 02-16-2021 01:38 AM by robve.)
Post: #6
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Thanks for posting. A good motivation to write some code on HP Prime. You did not mention that RPN is required...
#1 I couldn't find a way to run HP Prime programs with bigint (only up to 64bit), so the full decimal result is computed and displayed with HP Prime CAS in the code below. Here is another puzzle: Compute the smallest set(s) of square numbers that sum up to 2021. In other words, what are the sets of fewest square numbers that sum up to 2021 such that each square number is used at most once? For example, 1+9+36 sums up to 46 and 1=1^2, 9=3^2, 36=6^2 are square numbers. The size of this set is three, which is minimal since no two square numbers sum up to 46. Another solution is 1+4+16+25=46, but that solution has four square numbers and thus is not a minimal set. There may be multiple minimal sets of square numbers for 2021. A set is minimal if no other set exists that is smaller. Since we want to write some code, let's verify that powers of 3 give the max, by brute force trying all products from 2 to sqrt(2021). We use log here, which means we can simply sum up instead of using products, e.g. to prevent overflow on some calculators (but HP Prime handles large floats.) EXPORT T2021() BEGIN LOCAL N := 2021, M := 0, J, K, R, X; FOR I FROM 2 TO SQRT(N) DO K := FLOOR(N/I); R := N-K*I; IF R=0 THEN R := 1; END; X := K*LN(I)+LN(R); IF X>M THEN M := X; J := I; END; END; MSGBOX(J); MSGBOX(e^M); END; After playing with this, it is interesting that 3 is best. The reason is that 3 is close to the number e, which you can easily see is the best number to pick, because we have that N/3*LN(3)<N/e and N/2*LN(2)<N/e for any N>0 e.g. N=2021. Graphing N/x*LN(x) shows x=e is optimal. The full number is displayed in HP Prime CAS: 2*3^673 253299552188682629232814965512779393971107964856998090492681307089060025796755578 808413238305232345813667540825378197488286425521231426450591180750065933882457334 555696326219823274718662880838327321358161962623367953348770606025349498189611266 4520885716630483899029142003916544644957076791520721759240671604739781810307846 "I count on old friends to remain rational" |
|||
01-03-2021, 09:11 PM
Post: #7
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
RE #1
With a brute force approach, I searched for the largest product of: (2021/n)^n Code:
|
|||
01-04-2021, 09:12 AM
(This post was last modified: 01-04-2021 09:14 AM by J-F Garnier.)
Post: #8
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
(01-02-2021 09:24 PM)J-F Garnier Wrote: I was inspired by [the] 2nd problem: Here is my solution, not for the HP-71 but the 32S (not even the 32SII) that is, as I mentioned several times, my favourite machine for simple calculations. Well, I cheated a bit since I used the observation I made in my previous message :-) so the execution time is reduced to less than two minutes including keystrokes. Not bad for this machine.... Code:
J-F |
|||
01-04-2021, 03:00 PM
Post: #9
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Code:
|
|||
01-04-2021, 03:59 PM
(This post was last modified: 01-04-2021 04:41 PM by StephenG1CMZ.)
Post: #10
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
On the HP Prime, I get a result for number 2 if I use the constant 2.021 (2.021 approximately 2).
But if that "." is meant to be a thousands separator rather than decimal, representing the year 2021 rather than the year 2 ![]() (And to get the answers others are giving, remember to change log into Ln) Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
01-04-2021, 04:16 PM
(This post was last modified: 01-04-2021 04:17 PM by Albert Chan.)
Post: #11
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Code:
reference: http://fmnt.info/blog/20180818_infinite-integrals.html |
|||
01-04-2021, 05:56 PM
Post: #12
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
For problem 1, I don't understand the Y^X function showing up in the answers... ?
A + B + C = 2021 (or however many #'s you propose in your solution) Then A x B x C = Big number. 505 + 505 + 505 + 505 + 1 works, but the product would be 505 x 505 x 505 x 505 x 1 or 6.5038 x 10^10. Biggest number I can see is a portion of the factorial. For example 63! = (roughly) 1.98 x 10^87. The sum of 63, 62, ... down to 2 is 2015. So with a little adjustment, one could get 2021 as a sum and something in the 10^80-something as a product. Think I've missed something :-) but don't see where. Wouldn't be the first time! |
|||
01-04-2021, 06:24 PM
(This post was last modified: 01-04-2021 06:26 PM by ijabbott.)
Post: #13
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Here's my quick and dirty RPL solution for #1:
Code:
— Ian Abbott |
|||
01-04-2021, 07:08 PM
Post: #14
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
(01-04-2021 05:56 PM)Gene Wrote: Biggest number I can see is a portion of the factorial. No, we would like as many equal numbers as possible. Say, we partition number N into n parts. AM-GM inequality: \(\Large{x_1\,+\,x_2\,+\,x_3\,+\,\cdots\,+\,x_n \over n} \normalsize ≥ \sqrt[n]{x_1\;x_2\;x_3\;\cdots\;x_n}\) LHS = N/n = constant RHS = LHS, i.e. maximized products, when \(x_1 = x_2 = x_3 = \cdots = x_n\) |
|||
01-04-2021, 07:24 PM
Post: #15
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Ah, now I see it more clearly.
For example... 2 + 2 + 2... + 2 + 21 (suppose there are one thousand 2's there). Sum is 2021. Product is 2^1000 x 21 which is huge... and still not the biggest. ty |
|||
01-04-2021, 08:27 PM
(This post was last modified: 01-04-2021 08:56 PM by ijabbott.)
Post: #16
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Some clues:
Code:
Conclusion: Code:
For example: Code:
— Ian Abbott |
|||
01-04-2021, 08:36 PM
Post: #17
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
As to No. 1, my candidate for greatest product exceeds my candidate for second-greatest by 12.5%. I'll explain later. I obtained these results without coding, but I knew the route to a solution many years ago.
Valentin, while we wait for your solutions, would you be willing to tell us how you came to choose the number 5, in gold, as your avatar/icon? I ask because the image was a puzzle until yesterday, when I saw that number on a postcard. |
|||
01-04-2021, 11:52 PM
Post: #18
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
.
Hi, telemachos: (01-04-2021 08:36 PM)telemachos Wrote: Valentin, while we wait for your solutions, would you be willing to tell us how you came to choose the number 5, in gold, as your avatar/icon? Well, being very fond of both the number 5 and fine art, I've liked Charles Demuth's 1928 painting "I Saw the Figure 5 in Gold" since I saw it for the first time many decades ago, and I thought it would make a very nice, classy, artistic avatar for me in the MoHPC's forums, which it does. Full info on the painting here Thanks for your interest in both my SRC #008 and my avatar ! ![]() Best regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
01-05-2021, 03:39 AM
(This post was last modified: 02-16-2021 01:41 AM by robve.)
Post: #19
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
My solution for #1 is in my earlier post with the non-CAS program listing, followed by the full number printed with HP Prime CAS. But if you really can't accept the number printed with HP Prime CAS, then below is a simple non-CAS program to produce the full decimal result as a list of digits:
EXPORT POWER3() BEGIN L0:=MAKELIST(0,I,1,322); L0(SIZE(L0)):=2; FOR N FROM 1 TO 673 DO L1:=L0; FOR T FROM 1 TO 2 DO C:=0; FOR I FROM SIZE(L0) DOWNTO 1 DO D:=L0[I]+L1[I]+C; IF D>9 THEN D:=D-10; C:=1; ELSE C:=0; END; L0[I]:=D; END; END; END; PRINT(L0); END; "I count on old friends to remain rational" |
|||
01-05-2021, 06:32 PM
(This post was last modified: 01-05-2021 06:33 PM by Valentin Albillo.)
Post: #20
|
|||
|
|||
RE: [VA] SRC #008 - 2021 is here !
Hi all: Thanks for your interest in this SRC #008, many more replies than I expected, many correct solutions and last but not least, A-Chan finally saw the light and actually refrained from posting solutions using everything but HP calcs in my threads, and has posted HP-71B code ! Shocking ! ![]() To express my gratitude, and as we say in Spain "No hay dos sin tres", I've edited my original post to include a third 2021-related question, namely this one:
As I've added this third "teaser" I'll delay posting my own solutions to all three for a few days, to allow you to ponder it and post your own solution. Thanks again and best regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)