Post Reply 
[VA] SRC #016 - Pi Day 2024 Special
03-16-2024, 03:58 PM (This post was last modified: 03-16-2024 05:20 PM by Gerson W. Barbosa.)
Post: #6
RE: [VA] SRC #016 - Pi Day 2024 Special
(03-16-2024 02:34 PM)Juan14 Wrote:  Given N, this program calculates the value for the "Second appearance", I no longer have the HP-50g, so I ran it in an emulator.
«
0. 1 PICK3
START
RAND RAND 2 →LIST PICK3 * 1 ADD IP EVAL GCD 1 == +
NEXT / 6 * √
»

I set RDZ to 0.5 one time before running the program.

For N=10: 3.46410161514
For N=100: 3.08606699924
For N=1000: 3.19166997285
For N=10000: 3.14037146511
For N=100000: 3.14975602148
For N=1000000: 3.1401805004

For the last value, the program ran for almost 25 minutes and only the first 3 digits are accurate.

Mine is still running for 20 minutes or so. I guess it’ll take a bit longer than yours as I missed your optimization.

« 1 6
FOR n n ALOG 0 1 PICK3
START n ALOG DUP RAND * 1 + IP SWAP RAND * 1 + IP GCD 1 == { 1 + } IFT
NEXT SWAP 6. * SWAP / √
NEXT
»


I’ve used 1 RDZ. Still waiting for the results as I post this.

Gerson.

P.S.: It took about one and a half hour, but I’ve finally obtained the results. Some optimizations are definitely required.

2.92770021885
3.27326835354
3.17553674414
3.14476811662
3.14494955129
3.14146631543
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #016 - Pi Day 2024 Special - Gerson W. Barbosa - 03-16-2024 03:58 PM



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