[VA] SRC #013 - Pi Day 2023 Special
|
03-14-2023, 06:22 PM
(This post was last modified: 03-18-2023 02:16 AM by Valentin Albillo.)
Post: #1
|
|||
|
|||
[VA] SRC #013 - Pi Day 2023 Special
Hi, all, Just in case you hadn't noticed, today it's March, 14 aka \(\pi\) Day, so Happy Pi Day 2023 and Welcome to my SRC #13 - Pi Day 2023 Special
(We just enjoyed this nice Pi Day's Oreo cake for lunch, courtesy of my daughter Laura's haute cuisine abilities) This SRC #13 is intended to commemorate once more this most ubiquitous constant, \(\pi\). There are many other threads about Pi Day 2023 but this one is mine. After posting a number of threads over the years about \(\pi\) Day, such as these,
SRC #009 - Pi Day 2021 Special SRC #006 - Pi Day 2020 Special: A New Fast Way to Compute Pi
1. Let's count ... \(\pi\)'s value can be obtained by evaluating a plethora of transcendental functions, infinite summations and products, definite integrals, stochastic processes, etc., but if you don't remember any of them you can still get a nice approximation to the value of \(\pi\) (exact as N goes to infinity) by following these simple steps:
2. Tally up how many integers in the range 1...N have no repeated prime factors 3. Output Now write your very own program and try N = 12,345, 100,000, 567,890 and 1,000,000 to see if you get the following results, which I obtained using this little witty 4-line (217-byte) HP-71B program I wrote for the occasion (uses Math and JPC ROMs; 179 bytes without USING "image"):
2 ... 3 ... 4 DISP USING "2(3DC3DC3DC3D,2X),2(Z.8D,X),5DZ.2D";T,S,SQR(6*T/S),ABS(PI-RES),TIME >RUN -> ? 12345 -> ... , etc. N Count \(\pi\) approx |Error| go71b Emu71/Win Physical @128x @976x HP-71B ------------------------------------------------------------------------ 12,345 7,503 3.14198205 0.00038939 0.10" 0.01" 13" 100,000 60,794 3.14155933 0.00003333 0.28" 0.04" 36" 567,890 345,237 3.14158684 0.00000582 0.69" 0.09" 1' 28" 1,000,000 607,926 3.14159550 0.00000285 0.93" 0.12" 1' 59" Well, see if you can deliver and, if feeling venturous and your calc is up to it, post also the results and timings for N = 10 million, 25 million and 33 million (which gives an approximation to \(\pi\) correct to 8 digits.) If I see interest, I'll post my original solution & comments in a few days and part #2 next April, 1st. That's all. Any and all constructive and on-topic comments will be most welcome and appreciated. V. Edit: some errors corrected. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)