Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 86c3d80c4d6e905f610c100030811165 > files > 50

mathomatic-14.5.5-1mdv2010.0.i586.rpm

; This is the famous Bailey-Borwein-Plouffe (BBP) formula.
; Sum this n = 0 to infinity to compute pi.
; This is especially useful for calculating pi in hexadecimal.
; One hexadecimal digit of pi is generated with each iteration.

((4/((8*n)+1))-(2/((8*n)+4))-(1/((8*n)+5))-(1/((8*n)+6)))/(16^n)
simplify
sum n 0 10 ; Sum as n = 0 to 10 in steps of 1.
pi ; The digits should be the same.
x^n/n! ; Sum this n = 0 to infinity to compute (e^x).
replace x with 1 ; Sum this n = 0 to infinity to compute e:
sum n 0 20 ; Sum as n = 0 to 20 in steps of 1.
e ; The digits should be the same.