Ed S on Nostr: #bbcmicrobot 🚀 REM Compute pi using K S Brown's method REM Outer loop is to test ...
#bbcmicrobot 🚀
REM Compute pi using K S Brown's method
REM Outer loop is to test several possibilities
REM but only the final one is needed
REM in this case it is cherry-picked!
FOR N%=140 TO 560 STEP 20
F%=N%
FOR D%=N%-1 TO 2 STEP -1
F%=(F%-1)DIVD%*D%+D%
NEXT
P=N%*N%/F%
PRINT ;N%;" ";P
NEXT
PRINT "pi approximations after K S Brown"
REM Compute pi using K S Brown's method
REM Outer loop is to test several possibilities
REM but only the final one is needed
REM in this case it is cherry-picked!
FOR N%=140 TO 560 STEP 20
F%=N%
FOR D%=N%-1 TO 2 STEP -1
F%=(F%-1)DIVD%*D%+D%
NEXT
P=N%*N%/F%
PRINT ;N%;" ";P
NEXT
PRINT "pi approximations after K S Brown"