#Please do not post homework
#Guy Adami, 2026-02-15, Assignment 7

#————————————————————————————————————————
#C7.txt Maple code for Dr. Z.'s Math 640 class, Feb. 12, 2026, in memory of Dr. Jesus Guillera, with guest-lecturer Professor Wadim Zudilin
#Code created after class
Help7:=proc(): print(`JG1(N), JG2(N), RF(a,n), HowManyDigits(f,N) `):end:

#RF(a,n): The rising factorial (aka Pochammer symbol) a(a+1)...(a+n-1). Note that RF(1,n)=n!
RF:=proc(a,n) local i: mul(a+i,i=0..n-1):end:

#Inputs a pre-coded procedure for computing Pi via an infinite series, the number of digits that
#agree with Pi if you truncate it after the term n=N. For example
#HowManyDigits(JG1,40); should return 123, meaning that if you truncate the series after 40 terms
#it would agree with Pi to 123 digits
HowManyDigits:=proc(f,N) :
Digits:=10000:
-trunc(log[10](abs(evalf(f(N)-Pi)))):
end:

#JG1(N): The first N terms in the Guillera formula in his homepage using Ramanujan-style ... notation
JG1:=proc(N) local i,n,a:
a:=
add((mul(2*i-1,i=1..n)/mul(2*i,i=1..n))^5*(13+20*n*(50+41*(n-1)))*(-1/2^10)^n,n=0..N):
sqrt(128/a):
end:

#The first formula in page 6 of Jesus Guillera's thesis 
#http://anamat.unizar.es/jguillera/pdf-files/Guillera-thesis2007.pdf
JG2:=proc(N) local n,a: a:=add(RF(1/2,n)*RF(1/3,n)*RF(2/3,n)/n!^3*(2/27)^n*(15*n+2),n=0..N): (27/(4*a)):end:

#_______________________________________

#HowManyDigits(JG1,32) = 99
#HowManyDigits(JG1,33) = 102

#Requires the series to have a minimum length N=33 to have >= 100 digits of precision

#_______________________________________

#2010 conjectured formula

Jga1:= proc(N) local i,n,a,PI:
	a:= add(  (((6*n)!)/ ((n!)^6))* ( (532*n^2 + 126*n + 9)/ (10^(6*n)) ),n=0..N):
	PI := ( (375/4)*(a)^(-1) )^(1/2):
	PI:
end:

#HowManyDigits(Jga1, 101) = 136

#————
#2003 formula

Jga2:= proc(N) local i,n,a,PI:
	a:= add( (-1)^n * ( (6*n)! / (n!)^6) *( (5418*n^2 + 693*n + 29)/2880^(3*n) ),n=0..N):	
	PI := (128*sqrt(5)/a)^(1/2):
	PI:
end:

#HowManyDigits(Jga2, 101) = 582

#————
#2018

Jga3:= proc(N) local i,n,a,PI:
	a:= add( (-1)^n * (((3*n)!*(2*n)!)/(n!)^5) *((14151*n + 827)/300^(3*n) ),n=0..N):	
	PI := (1500*sqrt(3)/a):
	PI:
end:

#HowManyDigits(Jga3,101) = 550

#————
#Thesis pg 2 Eq 3

Jga4:= proc(N) local i,n,a,PI:
	a:= add( ( ((RF(1/2,n))*(RF(1/4,n))*(RF(3/4,n))) / (n!)^3 ) * ((-1)^n/882^(2*n)) * (21460*n + 1123),n=0..N):	
	PI := (3528/a):
	PI:
end:

#HowManyDigits(Jga4, 101) = 1446

#————
#Thesis pg 2 Last Eq.

Jga5:= proc(N) local i,n,a,PI:
	a:= add( ( (RF(1/2,n))^3 / (RF(1,n))^3 )*(97-56*sqrt(3))^n * (sqrt(78*sqrt(3) - 135) + 6*sqrt(14*sqrt(3) - 24) *n) ,n=0..N):	
	PI := (1/a):
	PI:
end:

#HowManyDigits(Jga4, 101) = 233

#_________________

#Jga4 which is the  3rd equation on page 2 of the thesis had the most digits at n=101 with 1446