Post Reply 
[VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier"
04-07-2019, 04:58 PM
Post: #29
RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier"
Though I did not participate in this challenge, I have taken the liberty of adapting Valantin's Albert's programs into RPL with a twist- unlimited precision.

This program does not run until convergence but a fixed number of iterations, which is the number n that is input into the program. The program requires the external libraries ListExt, GoferLists, and Long Float.

%%HP: T(3)A(R)F(.);
@ Generate list of primes:
\<< \-> n
\<< 2 2 n
START DUP NEXTPRIME
NEXT n \->LIST
@ Inverse binomial transform of above list:
DUP HEAD SWAP 2 n
START \GDLIST DUP HEAD SWAP
NEXT DROP n \->LIST
@ List of factorials 0 through n:
1 n 1 - LSEQ
\<< *
\>> Scanl1 +
@ Divide to form list of ratios:
/
@ Accumulate above list:
\<< + EVAL
\>> Scanl1
@ Convert to list of LongFloats:
1.
\<< \->FNUM
\>> DOLIST
\>>
\>>

To begin, store a number into the variable DIGITS which sets the precision that LongFloat uses. In this example, I used 50. for DIGITS and 60 for the number of iterations.

I then used the following simple program to turn the resulting list into a string suitable for display or printing:

\<< \->STR 3. OVER SIZE 2. - SUB " " 13. CHR 10. CHR + SREPL DROP
\>>

The result:

2
3
35000000000000000000000000000000000000000000000000.E-49
33333333333333333333333333333333333333333333333333.E-49
34583333333333333333333333333333333333333333333333.E-49
33833333333333333333333333333333333333333333333333.E-49
34152777777777777777777777777777777777777777777778.E-49
34047619047619047619047619047619047619047619047619.E-49
34076140873015873015873015873015873015873015873016.E-49
34069609788359788359788359788359788359788359788360.E-49
34070869157848324514991181657848324514991181657848.E-49
34070668490460157126823793490460157126823793490460.E-49
34070693813966383410827855272299716744161188605633.E-49
34070691583365194476305587416698527809638920750032.E-49
34070691634410012386202862393338583814774290964767.E-49
34070691662452161790786129410468034806659145283484.E-49
34070691655244232025812713643401474089304777135465.E-49
34070691656406347881896434650869758246042092914175.E-49
34070691656257873262373750840742575708166882908384.E-49
34070691656273966717789714824786163263074495403684.E-49
34070691656272442599684037804120145048719207427525.E-49
34070691656272570305882488238644909673728392032261.E-49
34070691656272560845399289953795750049707556470279.E-49
34070691656272561452781304231311072994035926413957.E-49
34070691656272561421162961843454416475655340721354.E-49
34070691656272561422168859510781044267796095465102.E-49
34070691656272561422203623227227792237954574766870.E-49
34070691656272561422193499936605021028268165932935.E-49
34070691656272561422194680710735493212204028544306.E-49
34070691656272561422194575066153490058695686270606.E-49
34070691656272561422194583144322191113049301542936.E-49
34070691656272561422194582596611005303547258196512.E-49
34070691656272561422194582630026111767164206858021.E-49
34070691656272561422194582628184366702426127844481.E-49
34070691656272561422194582628275666348866780110705.E-49
34070691656272561422194582628271661692858309901367.E-49
34070691656272561422194582628271810600936280034971.E-49
34070691656272561422194582628271806504336081216950.E-49
34070691656272561422194582628271806529151697629234.E-49
34070691656272561422194582628271806536170465629760.E-49
34070691656272561422194582628271806535499300745912.E-49
34070691656272561422194582628271806535542548688840.E-49
34070691656272561422194582628271806535540241528738.E-49
34070691656272561422194582628271806535540348557090.E-49
34070691656272561422194582628271806535540344239572.E-49
34070691656272561422194582628271806535540344383289.E-49
34070691656272561422194582628271806535540344380187.E-49
34070691656272561422194582628271806535540344380140.E-49
34070691656272561422194582628271806535540344380151.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380149.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380149.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380151.E-49
34070691656272561422194582628271806535540344380150.E-49
34070691656272561422194582628271806535540344380151.E-49

It can be observed that:

-- LongFloat numbers are not very user-friendly. Smile

-- There is noise in the last digit, so really 49-digit accuracy in this case.

-- Rate of converge increases, only about 56 iterations required to confirm 49 digits.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - John Keith - 04-07-2019 04:58 PM



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