Post Reply 
[VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math"
02-25-2021, 11:52 PM
Post: #36
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math...
      
Hi all,

As I stated in my earlier post featuring my solution to "Concoction the First: Weird Limit", I'll give the solutions one Concoction at a time, and so here you are, my original solution for "Concoction the Second: Weird Sum", with the same Sections and structure, including The Hall of Fame !

Note: My HP-71B code might use keywords from the JPC ROM, MATH ROM, HP-IL ROM and STRINGLX LEX file, executed on go71b, while RPN code is for the HP-42S, executed on a DM42.


My original solution for "Concoction the Second: Weird Sum"

[Image: TEST5-DISREGARD.jpg]

What'so weird about this sum ?


The Sleuthing

I'll describe in detail a typical sleuthing procedure to try and answer the above question. First of all, the summation can be expanded as:

      Sum = 1/(2021+2) + 2/[(2021+2)*(2021+3)] + 2*3/[(2021+2)*(2021+3)*(2021+5)]
                                   + 2*3*5/[(2021+2)*(2021+3)*(2021+5)*(2021+7)] + ...

             = 1/2023 + 2/4094552 + 6/8295562352 + 30/16823400449856 + ... = 4.94804552195E-4 + ...


and a quick glance convinces me that for 2021 the infinite summation converges very quickly and so I'll use a set of just 10 coefficients (the first 10 primes) to evaluate the sum, which will give more than 12 correct digits. This trivial 4-line, 104-byte HP-71B program will do, let's run it:

      1  DESTROY ALL @ INPUT N @ S=0 @ T=1 @ A=1
      2  DATA 2,3,5,7,11,13,17,19,23,29
      3  FOR I=1 TO 10 @ READ B @ T=T*A/(N+B) @ S=S+T @ A=B @ NEXT I
      4  DISP S

      >RUN
       ?   2021 [ENDLINE] -> 4.94804552201E-4


which is the correct 12-digit result. Now, what's this value, can we identify it ?. Well, let's edit line 4 to use the FRAC$ keyword to convert the real value to a rational approximation and run the program again: (Note: FRAC$ is a keyword from the JPC ROM, if unavailable you can use my DEC2FRC subprogram to obtain a rational approximation):

      4  DISP S;"= ";FRAC$(S)

      >RUN
       ? 2021 [ENDLINE] -> 4.94804552201E-4 = 1/2021


so the sum's value is recognized as 1/2021, which is quite unexpected and thus weird. Will this hold for values other than 2021 ?. Let's try some at random:

      >RUN
      ?       2028 [ENDLINE] ->  4,93096646943E-4 =  1/2028
      ?       1007 [ENDLINE] ->  9.93048659383E-4 =  1/1007
      ?      -1357 [ENDLINE] -> -7.36919675757E-4 = -1/1357


and yes, it indeed holds for other values ! So, it seems the infinite sum using the set of primes will be equal to the reciprocal 1/N of the given value N, where N = 2021 in the original sum.

That using the set of primes we obtain the reciprocal 1/N for other values of N is even weirder but, are we done ? What happens if we use sets other than the prime numbers ? Let's try this by editing the program to use N = 2021 and accept any 10-element set from the user. The edited program looks like this 4-line, 111-byte program:

      1  DESTROY ALL @ OPTION BASE 1 @ DIM P(10)
      2  S=0 @ T=1 @ A=1 @ N=2021 @ MAT INPUT P @ FOR I=1 TO 10
      3  B=P(I) @ T=T*A/(N+B) @ S=S+T @ A=B @ NEXT I
      4  DISP S;"= ";FRAC$(S)


Now let's RUN it with assorted sets, namely:

      - The set of prime numbers  :  P(1)?  2,3,5,7,11,13,17,19,23,29  ->  4.94804552201E-4 = 1/2021
      - The set of natural numbers:  P(1)?  1,2,3,4, 5, 6, 7, 8, 9,10  ->  4.94804552203E-4 = 1/2021
      - The set of digits of Pi   :  P(1)?  3,1,4,1, 5, 9, 2, 6, 5, 3  ->  4.94804552202E-4 = 1/2021
      - The set of all elements 0 :  P(1)?  0,0,0,0, 0, 0, 0, 0, 0, 0  ->  4.94804552202E-4 = 1/2021
      - Any set of random numbers :  P(1)?  RND,RND,RND, {7 more RND}  ->  4.94804552201E-4 = 1/2021

      
and for the cherry on top, this modified version (edits in bold) will let me demonstrate that the same result is produced when using arbitrary complex sets:

      1  DESTROY ALL @ OPTION BASE 1 @ COMPLEX P(10),A,B,S,T 
      2  S=0 @ T=1 @ A=1 @ N=2021 @ MAT INPUT P @ FOR I=1 TO 10
      3  B=P(I) @ T=T*A/(N+B) @ S=S+T @ A=B @ NEXT I
      4  DISP S;"= ";FRAC$(REPT(S))

      >RUN  ->  P(1)?  (1,3),(0,2),(-3,1),(2.1,1),(1,-2),(0.6,PI),(-3,1),(0,0),(1,5),(10,10)
            ->  (4.94804552201E-4, -1.488..E-18) = 1/2021



The Results

Considering all the data obtained above, I can summarize the results as follows:
  • The value of the original infinite summation is 4.94804552201E-4, identified as 1/2021.
What's so weird about this sum ?
  • For the original summation (N = 2021, set of primes) the sum converges to 1/2021, which is weird.
     
  • For any N (real or complex !) such that ABS(N)>1, the sum converges to 1/N, which is weirder.
     
  • For any such N, the sum is independent of the set used (even if complex), which is weirdest.

The Comments

The reason why this infinite summation produces the reciprocal 1/N of a given N (not necessarily 2021, as long as ABS(N)>1) can be better understood by considering the finite sum up to some index K, namely:

[Image: ZZSSMC25B02.jpg]

where the right-hand side is obtained by expanding the left-hand side sum into its separate terms and noticing that each term is of the form Ak-1 - Ak so that the sum becomes:

      Sum = (A0 - A1) + (A1 - A2) + (A2 - A3) + ... + (AK-1 - AK)

which is a telescoping series: all its terms cancel out except the first and the last, i.e:   Sum = A0 - AK,   where A0 and AK are as seen in the right-hand side of the above formula.

Now, this finite version of the sum does depend on the set of values a1, a2, ..., aK used, as they do clearly appear in the right-hand side of the formula, but when we take it to the limit K -> Inf, then the component A0 = 1/x in the right-hand side remains intact but the other component, which includes all the ak coefficients, tends to 0, and thus the infinite sum becomes independent of the set of ak used and we indeed have that

[Image: ZZSSMC25B01.jpg]


The Hall of Fame

Again, some of you did bravely tackle this Concoction the Second: Weird Sum, namely these four experts:
  • robve posted code for the HP Prime and got the correct sum, which he correctly identified, as well as the fact that using other N converges to 1/N.
     
  • Werner posted RPN code and also got the correct sum and the correct identification.
     
  • J-F Garnier correctly identified the sum and also discovered that other values N converged to 1/N and that using the natural numbers instead of the primes also gave the same sum.
     
  • PeterP posted RPN code and correctly identified the sum, and also that using another N converged to 1/N and that using the prime numbers is irrelevant and one could use any sequence of numbers, even a constant 1.


That's all for now, as always thanks a lot to those who contributed, I really hope you enjoyed it. I'll post my original solutions for "Concoction the Third: Weird Integral" in a couple of days. Stay tuned !  Smile
  • Note: For any comments not directly related to the math or code here but to ancillary matters such as this or that opinion on the rules or "Halls of Fame" or whatever, please PM me instead of posting them here. Let's keep this thread strictly mathematical and algorithmical in nature. Thanks.

Best regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math... - Valentin Albillo - 02-25-2021 11:52 PM



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