; 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.
