Math 640: EXPERIMENTAL MATHEMATICS
Spring 2018 (Rutgers University) Webpage
http://sites.math.rutgers.edu/~zeilberg/math640_18.html
Last Update: April 30, 2018.
 Teacher:
Dr. Doron ZEILBERGER ("Dr. Z")

Classroom:
Allison Road Classroom Building
[Busch Campus], IML Room 116.
[Except Jan. 25, 2018, where it is at Hill 425, and we would have guestlecturer Dr. Neil Sloane ]

Time: Mondays and Thursdays , period 3 (12:00noon1:20pm)

Main Textbook: "Lectures on the Riemann Zeta Function"
by Henryk Iwaniec.
Other texts used:

Donald Newman's short proof by Don Zagier

Bernhard Riemman's memoir (English translation)
[original,
original mansuscript]

proof of the modularity of the theta function, scanned
from pp. 5253 of the classic book "Fourier Series and Integrals" by Dr. Z. academic father and grandfather (Harry Dym and Henry McKean respectively).

George Polya's beautiful elementary proof, scanned
from pp. 4041 of the classic book "A brief introduction to Theta Functions" by Richard Bellman.

The first 100000 zeros of Zeta(s), (downloaded from the Andrew Odlyzko's website)

The first 100000 zeros of Zeta(s), (as a Maple list called Z10) [Thanks for
Ahshan Kahn for the conversion).
 Brendan W. Sullivan's fascinating article on
"Numerous Proofs that ζ(2)=π^{2}/2"

Dr. Z's gorgeous combinatorial proof of Newton's identitities.
Recall that Newton's identities, generalized to "infinite" polynomials, enabled Euler to evaluate Zeta(2n).
[For a determinant formula for the power sums, p_{n} in terrms of the elementary symmetric functions, e_{n}, see p.28 of
Ian Macdonald's classic book, "Symmmetric Functions".]

Chris Houghes' nice article on the moments of the Riemann Zeta function and Random Matrix Theory

The wikipedia article on Hough Montgomery's Pair Correlation Conjecture.

Atle Selberg's seminal paper on the zeros of Zeta(s) on the Critical Line.

A few pages from G. Chrystal's classic book "Textbook of Algebra" to prove that
Pi is irrational (used on March 8, 2018, in early celebration of Pi Day, that falls during Spring break.)

Oswald Veblen's beautiful proof that Pi and e are transcendental

The masterpiece
Pythagorean Primes and Palindromic Continued Fractions,
(that appeared in INTEGERS 5(1) (2005), A30),
by Dr. Z. and mathmagician Arthur Benjamin, that has a combinatorial approach to Henry J.S. Smith's nice proof that every prime that is 1 mod 4 is a sum of
two squares.

Attempted proof of RH
by Nagy Adel, Mena Asham, and Marian Fady.
(received by Dr. Z.'s on April 1, 2018)

E.C. Titchmarsh's classic monograph on
the Zeta Function of Riemann (revised by D.R. HeathBrown)

Richard P. Brent's paper confirming RH for the first 70 millions zeros of ζ(s)

Charles F. Van Loan's chariming article about iterating a polygon
that appeared in SIAM News, April 2018 issue.

Dr. Zeilberger's Office: Hill Center 704

Dr. Zeilberger's Email: DoronZeil at gmail dot com

Dr. Zeilberger's Office Hours (Spring 2018): MTh 10:45am11:30am and by appointment
Description
Experimental Mathematics used to be considered an oxymoron, but the future of mathematics is in that direction.
In addition to learning the philosophy and methodology of this budding field, students will become computeralgebra wizards,
and that should be very helpful in whatever mathematical specialty they are doing (or will do) research in.
We will first learn Maple, and how to program with it. This semester we will learn about the Riemann Zeta function,
following the terse, but crystalclear,
notes
of Professor Henryk Iwaniec, but we will really understand it, since we will program everything,
and the only way to really understand something is to program it.
There is no overlap with previous years.
The prerequisites are the standard courses in real and complex analysis.
In particular, no prior knowledge of Maple, or any programming experience, is assumed.
Also, no overlap with previous years.
Added Feb. 4, 2018: Read Don Zagier's nice exposition of Donald Newman's short proof
of the Prime Number Theory and
Normal Levinson's very lucid Elementary Proof of the Prime Number Theorem .
Optional (but Highly recommended) Getting Started Homework
Teach yourself the basics of Maple by reading Frank Garvan's goldenoldie
part 1,
part 2
Note: a few commands are no longer valid in today's Maple. The
most important one is that " has been replaced by %.
For more details, see this 2002 masterpiece.
How to submit homework

Every class has a homework assignment. Both Mondays and Thursdays' are due
10:00pm Sunday of the following week.
It should be sent to the email address
ShaloshBEkhad at gmail dot com
Subject: HomeWork#X
and then attach a .txt file(s) called
hwXYourFirstNameYourLastName.txt
where X is the number of the assignment
Except for the first assignment, you should have two attached .txt files.
For example, when Anthony Zaleski submits homework assignments 2 and 3, he should
email ShaloshBEkhad at gmail dot com, with
Subject: HomeWork#2#3
and attach the text files (the source code plus human comments (such lines must start with #)
hw2AnthonyZaleski.txt and hw3AnthonyZaleski.txt

The very first line of the .txt files should have
#Please do not post homework
or
#OK to post homework
Followed by
#Your Name, Date, Assignment X
Diary and Homework assignments
Programs done on Thurs., Jan. 18, 2018
C1.txt ,
Contains procedures
Homework for Thurs., Jan. 18, 2018, class (due Sunday Jan. 21, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#1
and an attachment
hw1FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.

[People who took this class before, or already know Maple, are exempt from this]
Read and do all the examples, plus make up similar ones,
in the first 30 pages of Frank Garvan's
awesome Maple booklet
(
part 1,
part 2)
Only record a small sample in hw1YourName.txt .

[For everyone, edited Jan. 21, 2018]. Which of the following sequences
Conv(1,1), Conv(Conv(1,1),1), Conv(Conv(1,1),Conv(1,1))
are already in the OnLineEncyclopedia of Integer sequences (give their serial number),
and which are not?
Hints:
For the first 20 terms, Conv(1,1), type, in Maple (after you uploaded C1.txt ),
seq(Conv(i>1,i>1,n),n=1..20);
For the first 20 terms, of Conv(Conv(1,1),1), type, in Maple
seq( Conv(i>1, i>Conv(i>1,i>1,i),n),n=1..20);
For the first 20 terms, of Conv(Conv(1,1),Conv(1,1)), type, in Maple
seq( Conv( i>Conv(i>1,i>1,i) , i>Conv(i>1,i>1,i),n),n=1..20);
Then copyandpaste these sequences to the window of the OEIS, and see what happens.

[Mandatory for experts, optional for novices]
Write another version of divisors(n), call it DivSmart(n), that first factorizes n, using the command ifactor (or otherwise) , and uses the fact that the set
of divisors of
p1^a1 *....* pk^ak is
the "Cartesian product" of {1,p1,...,p1^a1} x ... x {1,pk,...,pk^ak}
[Hint: you may use a recursive procedure, find the largest prime divisible by n, then the partest power, for which it appears, let's call it p^a,
then apply it recursively to n/p^a and then take the "Cartesian product" of the output with {1, ..., p^a}]
Added Jan. 20, 2018: Note that the "Cartesian product" is in quotes, I meant readly the "set product",
where AxB={ab  a in A, b in B}

[Optional big challenge, I don't know the answer]
Using Maple (or human ingenuity) , conjecture the answer to Problem 12014 in Jan. 2018 Monthly problems.
[Added Jan. 20, 2018: The convergence is so slow, that it is impossible to conjecture an answer. It looks like
you need to do it the human way. But once you derived the answer, you can check it with Maple, by taking n very large].
[Added Jan. 22, 2018: Edna Jones solved it completely (she got 3 dollars), and Matt Charlney and Yukun Yao solved it partially (they each got one dollar).]

[Optional Challenge, 5 dollars to be divided among solvers for each of the problems,]
Use Maple to prove as many problems in the
Jan. 2018 Monthly problems.
Added Jan. 22, 2018: Read the nice solutions .
Programs done on Monday Jan. 22, 2018
C2.txt ,
Contains procedures

Conv(L1,L2), inputs two LISTS L1, L2, and outputs the list that is the convolution
of length min(nops(L1),nops(L2))

Mo(n): The Mobius function from scratch, using (1.9) in Professor H. Iwaniec's masterpiece

M(n): the partial sum of Mo(n), the Mertens function

T(L): (1.11) inputs a sequence L and outputs a sequence of the same length
where the nth entry is the sum of L[d] over divisors of n

IT(L): The inverse of T(L)

phi1(n): phi(n), using the definition that phi(n) is the number of integers <=n coprime with n
Homework for Monday, Jan. 22, 2018, class (due Sunday Jan. 28, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#2
and an attachment
hw2FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.

[People who took this class before, or already know Maple, are exempt from this]
Read and do all the examples, plus make up similar ones,
in pages 3060 of Frank Garvan's
awesome Maple booklet
(
part 1,
part 2)
Only record a small sample in hw2FirstNameLastName.txt .

[Mandaotry for experts, optional but recommended to novices; Typo corrected Jan. 23, 2018 (thanks to Edna Jones)]
Write procedure phi2(n) using the formula n*prod(11/p, pn)
and procedure phi3(n) using the formula n*sum(mu(d)/d,dn). Verify that they are both the same as phi(n)
for n from 1 to 1000

[Mandaotry for experts, optional but recommended to novices. Modified Jan. 23 (thanks to Edna Jones)]
Let f(s):= abs(Zeta(1/2+s*I)), Find, the smallest zero (on the critical line), to ten decimal digits
Hint: One way is to start with a resolution, say, 0.1, and look at
seq(f(14+0.1*n),n=1..100)
and find the place where it is smallest, then make the resolution smaller, say, 0.001, and explore in the
neighborhood of the previous low place. Etc.

[Mandaotry for experts, optional but recommended to novices]
Program Equation (1.19) on p. 6 of Iwaniec' book, i.e. write a procedure
Lkn(k,n) that inputs k and n and outputs Λ_{k}(n)

[Mandaotry for experts, optional but recommended to novices]
Verify empirically (1.23) for m,n < 100
Added Jan. 24, 2018: Edna Jones noticed that the above statement is not valid for all m,n, but only if
they satisfy a certain condition between them. What is the condition?

[Mandaotry for experts, optional but recommended to novices]
Verify empirically (1.24) approximately for s=11, by truncating the infinite sums at 1000, and using evalf.

[For every one] Do a first reading of Chapter 2 of H. Iwaniec's great book
Added Jan. 29, 2018: Read the nice solutions .
Stuff done on Thurs. Jan. 25, 2018
Today we were fortunate to have a
guestlecture
by
guru Neil Sloane
Homework for Thurs., Jan. 25, 2018, class (due Sunday Jan. 28, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#3
and an attachment
hw3FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.

[People who took this class before, or already know Maple, are exempt from this]
Read and do all the examples, plus make up similar ones,
in pages 6190 of Frank Garvan's
awesome Maple booklet
(
part 1,
part 2)
Only record a small sample in hw3FirstNameLastName.txt .

[For everyone] Verify (1.1) for n all less than 1000 of the inequality (1.1) in
Jeff Lagarias' nice paper,
make sure Digits is high enough, say 50.

[Mandaotry for experts, optional but recommended
for novices] Write a Maple program (without peeking in the OEIS entry) that inputs a positive integer n and outputs the
first N terms of sequence A64413

[Optional Challenge, no deadline]
To do more with coordination sequences (and with no deadline), see
Dr. Sloane's notes on coordination sequences.
Please contact Dr. Sloane directly with any progress.
Added Jan. 29, 2018: Read the nice solutions .
Programs done on Monday Jan. 29, 2018
C4.txt ,
Contains procedures
Homework for Jan. 29, 2018 (due Sunday Feb. 4, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#4
and an attachment
hw4FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 4

[People who took this class before, or already know Maple, are exempt from this]
Read and do all the examples, plus make up similar ones,
in pages 90end of Frank Garvan's
awesome Maple booklet
(
part 1,
part 2)

[For everyone] Go over Chapter 2, and convince yourself that every step is not hard.

[For everyone] Find a typo in the second line above Eq. (2.10) on p. 10 of the book

[Mandatory for experts, optional but recommended for novices]
Write a program
CheckI212(g,x,a,b) ,
that inputs an expression g and a variable x, such that g is a function of x, and real numbers a and b
(such that a < b) and finds the ratio of the left side to the right side. Check that it is indeed ≤ 1 for
g=x^3, a=1, b=5 ; g=exp(x), a=2, b=3 ; g=1/x, a=1, b=4 .

[Mandatory for experts, optional but recommended for novices.]
Write a program
CheckI213(h,g,x,a,b) ,
that inputs expressions h and g and a variable x, such that h and g are functions of x, and real numbers a and b (a < b) and
finds the ratio of the left side to the right side. Check that it is indeed ≤ 1 for
h=x^2, g=x^3, a=1, b=5 ; h=x^3, g=exp(x), a=2, b=3 ; h=1/x^2, g=1/x, a=1, b=4 .

[Mandatory for experts, optional but recommended for novices. Corrected Feb. 3, 2018 thanks to Yukun Yao and Matthew Charnely]
Write a program
CheckI218(h,g,x,a,b) ,
that inputs expressions h and g and a variable x, such that h and g are functions of x, and real numbers a and b (a < b) and
finds the ratio of the left side minus the first term of the right hand side divided by H/(1θ).
You must first first find θ given by equation (2.15)
Check that it is indeed ≤ 1 for
h=x, g=C*x^3, a=1, b=5 ; h=x^4, g=C*exp(x), a=2, b=3 ; h=x^3, g=C*1/x, a=1, b=4 ,
where C is a constant (that you should find) that would make the hypothesis ,(2.15), correct.

Read and understand Chapter 3.
Added Feb. 5, 2018: Read the nice solutions .
Programs done on Feb. 1, 2018
C5.txt ,

vM(n): The vonMangoldt function log(p) is n=p^{a} 0 otherwise

CheckI18 (N): Checks (1.18) that log(n)=Sum(vM(d), d in divisors of n) for all n from 1 to N

Sx(x): sum of log(n) from 1 to x

CheckI24(x):Checks Eq. (2.4)

psix(x): the famous ψ(x), defined as the sum of log(p) over all prime powers p^a less than x

CheckI25half(x): cheks that Sx(x) equals the sum of ψ(x/m) for m from 1 to x
Homework for Feb. 1, 2018 (due Sunday Feb. 4, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#5
and an attachment
hw5FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 5

Use Maple to verify (both parts) of Problem 12022 in
Feb. 2018 Monthly problems.
for n ≤ 100 (and ALL x except x=1)
[Challenge (5 dollars to be divided): prove it for all n]

Use Maple to verify Problem 12023 in
Feb. 2018 Monthly problems.
for many randon α s.

[Challenge (5 dollars to be divided): prove it for all positive real α]

Write procedures CheckI36(x), CheckI37(x), CheckI38(x), to check Equations (3.6), (3.7), (3.8) respectively in
H. Iwaniec's great book .

Write a procedure M(x) using (3.9) and write a procedure CheckI311(x) that checks empirically Eq. (3.11)

Read pp. 1516 in H. Iwaniec's great book .

[Optional challenges, open until solved] Prove as many problems as you can from the Feb. 2018 Monthly problems.
Added Feb. 5, 2018: Read the nice solutions .
Programs done on Feb. 5, 2018
C6.txt ,

Z(s,N)

Ph(s,N): sum(log(p)/p^s, first N primes)

th(x): sum(log(p), p<=x)

EP(s,N): the product of 1/(11/p^s)) over the first N primes

CheckZ4(N,alpha,eps)

CheckZ5(N): checks (V) in Zagier's paper (under construction)
Homework for Feb. 5, 2018 (due Sunday Feb. 11, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#6
and an attachment
hw6FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 6

[typo corrected, Feb. 9, 2018, thanks to Edna Jones]
Get procedure CheckZ5(N) to work by first creating a list of floatingpoint numbers for (θ(x)x)/x^2 from 2 to N and
then adding them, i.e. replacing integration by summation

Read, and completely understand the proof in
Don Zagier's nice exposition of Donald Newman's short proof

Write a procedure
gT(f,t,z,T)
tha inputs an expression f in a variable t, a complex number z, and a real number T, and outputs
the integral of f(t)*exp(z*t) for t rom 0 to T. Experiment with several f and see for which ones the limit of g_{T}(0),
at T goes to infinity, seems to converge, and whether the limit seems to go to g(0).

[Optional Challenge]
Empiriclly (or better still, rigorously)
conjecture (or determine)
answers to the limits in problem 12026 in Feb. 2018 Monthly problems.
[Note added Feb. 8, 2018: the convergence is extremely slow, but Professor Kauers figured out the answer to the first limit,
using ingenuity and symbolic computation. Neither of us knows the answer to the second limit.
Update Feb. 9, 2018: Prof. Kauers also figured out the answer to the second limit, suprisingly, the first limit is very simple, and
the second limit is rather complicated. Can you find them?]
Added Feb. 12, 2018: Read the nice solutions .
Programs done on Feb. 8, 2018
Today we were fortunate to have as guest lecturer, Professor Manuel Kauers,
here are his
great notes,
and here the
Mathematica source code.
Homework for Feb. 8, 2018 (due Sunday Feb. 11, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#7
and an attachment
hw7FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 7

Inspired by Professor Kauers' guest lecture, but ising Maple, conjecture a linear recurrence operator annihilating the
sequece
sum(binomial(2*n,n+k)*binomial(n,k)^2,k=0..n)
(where N is the shift operator in n (for example the fiboancci numbers are annihilated by N^2N1 and n! by N(n+1)).
You may use procedure Findrec in Dr. Z.'s Maple package
FindRec.txt
(Type ezra(Findrecc) for instructions how to use it).

Having found the operator, try to use Dr. Z.'s Maple package
AsyRec.txt
to figure out the asympotic behavior of the above sequence (Use procedure Asy, or better still, AsyC).
Added Feb. 12, 2018: Read the nice solutions .
Programs done on Feb. 12, 2018
C8.txt ,

xi(s): the left side of the FE on p. 21 in H. Iwaneic's book, in other words the symmetrized version of the Zeta function

ZZ(): the list of the first 177 zeros of Zeta(s)

Check5C(n), where T is the nth zero of Zeta(s)
Special Homework for Feb. 12, 2018 (due Wed., Feb. 14, 2018, 6:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#8special
and an attachment
hw8specialFirstNameLastName.jpeg , or hw8specialFirstNameLastName.png , or hw8specialFirstNameLastName.gif
and indicate whether it is OK to post (in the body, not the attachment)

By using the plots package (type: with(plots); ), and procedures textplot and (if you wish) polarplot (or other commands, even plot3D), and lots of nice colors, create
as nice a Valentine as you can, whose inside says "I Love Experimental Mathematics". Export is as a .png or .jpeg or .gif
file (you may have to look up how to do it).
[Hint: one possibility is the polar plot of r=arccos(sin(θ)), make sure to have the option axes=none, i.e.
polarplot(arccos(sin(t)),t=0..2*Pi, axes=none)]
you are welcome to search the internest for nicer mathematical valentines, some with 3D.
The students will vote who is the nicest, and the winner witll win a chocolate valentine.
Added Feb. 14, 2018: Admire the beautiful valentines
designed by the students, using Maple.
Usual Homework for Feb. 12, 2018 (due Sunday Feb. 18, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#8
and an attachment
hw8FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 8

Using the plots package, write a procedure,Contour(R, delta) that inputs a (large) positive real number R, and a small positive integer delta,
and draws the the curve C in the proof of the analytical theorem in
Don Zagier's paper (p. 707)

Write a procedure, Check5D(s,N), that inputs a complex number s and a positive integer N less than 177, and checks, numerically
Fact D in H. Iwaniec's book (p. 21) where the product is taken over the first N roots, by taking the ratio of the left side to the right side,
and hopefully getting something close to 1.
What are: Check5D(3+I,10), Check5D(13+I,100) ?

Write a procedure, Check5E(x,N), that inputs a large real number, x and a positive integer N less than 177, and checks, numerically, fact E, where the
sum is over the first N roots of Zeta(s). (See (10.1), p. 37 for the meaning of the "sigma flat"), by taking the difference between the left side and the right side,
and hopefully getting something close to 0

Read and understand Chapter 6 (pp. 2324)
Added Feb. 19, 2018: Read the nice solutions .
Programs done on Feb. 15, 2018
C9.txt ,

Th(t,N): The truncated Jacobi theta function (with one variable)

CheckJac(t,N): checks numerically Jacobi's identity θ(1/t)=sqrt(t)θ(t)

A faster way (for small t) to compute Th(t,N) using Jaocbi's identity

CheckTay(p,x): Checks the correctness of Taylor's expansion (at x=0) for polynomials p of x

RaTP(x,N): a random trig. polynomial of period 1 of degree N
with integer coefficients less than 1001

FS(f,x,N): The Fourier series of a function f of x on [0,1], truncated to N

[modified Feb. 18, 2018, thanks to Matt Charnley]
FSn(f,x,N,x0): The Fourier series of a function f of x on [0,1], evaluated at x0, truncated to N,done numerically,
should be close (for large N) to subs(x=x0,f);
Homework for Feb. 15, 2018 (due Sunday Feb. 18, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#9
and an attachment
hw9FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 9

[Modified Feb. 18, 2018, thanks to Matthew Charnley, who won a dollar.]
Write a procedure
FindN(f,x,k,x0)
that inputs an explicit function f in the variable x, (for example) that is obviously continuos on the
open interval (0,1), and a positive integer k,
as well as a number x0 strictly between 0 and 1 (i.e. in the open interval (0,1))
and outputs the
smallest N such that abs(FSn(f,x,N,x0)subs(x=x0,f)) is less than 1/10^{k}, in other words what N should you take to guarantee k decimal digits. What are
(take Digits:=30)
FindN(1/(1+x)^3,x,3,0.5) , FindN(sin(cos(x)),x,3,0.8) , FindN(abs(x1/2),x,3,0.6), FindN(abs(x1/2),x,3,0.51), , FindN(abs(x1/2),x,3,0.501)

Read and understand these two pages, proving the identity that
is crucial for the proof of the functional equation for Zeta(s)
(Note the last paragraph of the proof is in the next page, that is not scanned,
but it is the end of the standard proof that int(exp(x^2),x=infinity..infinity) is sqrt(2*Pi) that you should know from
Calc3. (If I=int(exp(x^2),x=infinity..infinity) then I^2=int(exp(x^2),x=infinity..infinity)*int(exp(y^2),x=infinity..infinity)=
int(int(exp(x^2y^2),x=infinity..infinity),y=infinity..infinity), now convert to polar coordinates)

Read and understand Chapter 7 in H. Iwaniec's book

Write a procedure
Check82(f,R)
that checks Lemma 8.2 (p. 28) In H.Iwaniec's book for a holomorphic function f(z) and a positive real number R.
Try it out for
Check82(exp(z)*mul((zi),i=1..5),R);
for R=1,R=2,R=3,R=4,R=5, and R=7

Do a first reading of Chapter 8
Added Feb. 19, 2018: Read the nice solutions .
Programs done on Feb. 19, 2018
C10.txt ,

sin1(z,N): the partial product for Euler's product formula for sin(z)

Check92(n): checks (9.2) with T=the nth root of Zeta(s)

Check121(x,y,sig): checks (12.1) in H. Iwaniec's book
Homework for Feb. 19, 2018 (due Sunday Feb. 25, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#10
and an attachment
hw10FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 10

Read and understand Euler's proof that Zeta(2)=pi^2/6 as nicely told in Brendan Sullivan's paper
Numerous Proofs that ζ(2)=π^{2}/2.
Try to read and understand the proof for Zeta(2n).
Also read and understand Apostol's proof for Zeta(2).

Write a procedure Check127(t,x,N) that inputs a real number t and a real number x (not far from sqrt(sqrt(1/4+t^2)/(2*pi)) and
checks Eq. 12.7, where the infinite sums are replaced by sums from n=1 to n=N. Test the procedure with some reasonable inputs.

Recall the NewtonRaphson method (that also works for complex functions) that approximately finds a root of an equation P(z)=0 by starting
with an initial guess z0, and replaces it by z0P(z0)/P'(z0). Write a procedure
NR(f,z,z0,eps)
that inputs an expression (representing a function) f in the variable z, a complex number z0, and a small positive real number eps, and
outputs an approximate root obtained by iterating the above until the difference in absolute value of two consecutive iterations is less than eps.
Test it with several random polynomials and initial values with eps=1/10^{8}.

By using NR(Zeta(s),s, 1/2+I*n, 1/10^7), for integer n (starting with n=10) try to find, from scratch as many zeros of Zeta(s) that you can.
Compare it with the Odlyzko table.
Comment added Feb. 28, 2018: Edna Jones made the interesting comment that the reason NR does not converge to
the nearest zero is because (even for a cubic!) the beahvior is "chaotic" and the "basins of attraction"
are fractals. See wikipedia article .
Added Feb. 26, 2018: Read the nice solutions .
Programs done on Feb. 22, 2018
C11.txt ,
Contains

PfE(inputs a list of the [e1,...en] and outputs p_n (implementing the det. expression in
Ian Macdoland's famous book Symmetric Polynomials (p. 28))

DP(L1,L2,M): inputs the first nops(L1) terms of a Dirichlet polynomial (or series),P1
and similarly for L2, P2, outputs the first M terms of the product P1*P2

DerD(L,k): the kth derivative of the Dirichlet polynomial given by the list L

Dpo(L,k,N):the first N terms of the Dirichlet poly L^k
Homework for Feb. 22, 2018 (due Sunday Feb. 25, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#11
and an attachment
hw11FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 11

Read and understand Dr. Z's gorgeous combinatorial proof of Newton's identitities
and find the typo(s) [there is at least one], and correct it (them).

Write a Maple procdeure T(A,j,l) that implements the bijection, make sure that it is an involution. Also write a program
Wt(A,j,l,x) that outputs the weight.

Use Procedure PfE() to write a procedure ZetaEven(n) that inputs a positive integer and outputs Zeta(2n)

Try to see whether PfE([seq(1/(2*i)!,i=1..n)]), PfE([seq(1/(3*i+1)!,i=1..n)]) etc produce interesting sequences of rational numbers.

Write a procedure LogDerD(L,n) that inputs the first nops(L) coefficients of a Dirichlet polynomial A(s), and
outputs A'(s)/A(s) (Eq. (13.8) in Iwaniec's book.)

Write a procedure Check1312(L,T) that checks Theorem 13.1 (Eq. 13.12) for a Dirichlet polynomial, of degree nops(L), given by the list L.
Try it out for several random L and (large) T.

Write a procedure Check1318(T) that checks Eq. (13.18) (p. 50) of H. Iwaniec's book, by bounding the "implied constant".
How big is it?

Write a procedure Check1320(T) that checks Eq. (13.20) (p. 51) of H. Iwaniec's book, by bounding the "implied constant".
How big is it?

[Optional challenge, I have no clue, 5 dollars to be divided]
Explain the inequality sign going from line 4 of p. 50 to line 5 of p.50
in Professor Henryk Inwaniec's book "Lectures on the Riemann Zeta Function" .
Added Feb. 26, 2018: Professor Iwaniec confirmed that it was an error, see the corrected page .
[Thanks to Edna Jones]
Added Feb. 26, 2018: Read the nice solutions .
Programs done on Feb. 26, 2018
C12.txt ,
Contains

Mk(k,T):The kth moment of Zeta(1/2+i*t) from t=0 to t=T divided by T
(Warning: very slow)

OurInt(f,x,a,b,N): Numerical integration of the function of x given by the expression f from x=a to x=b, using the very naive midpoint rule, y dividing it into N rectangles

MkF(k,T,N):The kth moment of Zeta(1/2+i*t) from t=0 to t=T divided by T, done by using the very naive Midpoint rule

deltn(n):The spacing between the (n+1)th nontrivial and gamma_n:=nth nontrivial of
Zeta(n) times log(gamma[n]/(2*Pi)) /(2*Pi). It features in Hugh Montgomery' conjecture

HM(N,K): the list of partial sums delt(n)+...+delt(n+k) for k from 1 to K
Homework for Feb. 26, 2018 (due Sunday March 4, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#12
and an attachment
hw12FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 12

Write procedures TrapInt(f,x,a,b,N) and SimpsInt(f,x,a,b,N) for numerical integration

[Rephrased Feb. 28, 2018 (thanks to Edna Jones)]
Write procedures a(k,eps) that approximates a(k) by truncating the infinite product and sums (stopping them, at say
the Nth prime and then the 2Nth prime and making sure that their difference is less than eps)
For the definition of a(k)
see
Chris Houghes' nice slides on the
moments of the Riemann Zeta function and Random Matrix Theory,

Using SimpsInt(f,x,a,b,N) for sufficiently large N, and the above a(k,eps), verify empirically the The KeatingSnaith conjecture given on p.13
of Chris Houges' slides,
by writing procedure
KS(T,k)
that computes the ratio of the left side to the right side.
[Note: G(k) (k ≥ 2) is nothing but "iteratedfactorial": 0!*1!*...*(k2)! and G(1)=1, see wikipedia,
thanks to Edna Jones for correcting a previous error]
What are (approximations of) KS(100,3), KS(1000,3); KS(100,3), KS(100,4) ?

[corrected March 4, 2018, thanks to Edna Jones]
Write a procedure
VerifyHoughesP18(T,k) that computes the ratio of the left side to the right side in the conjecture on top of p.18 of
Chris Houges' slides.
What is the values of
VerifyHoughesP18(10000,2)?

[Rephrased Feb. 28, 2018 (thanks to Edna Jones)]
Write a procedure
VerifyGonekConj(T) ,
that computes the ratio of the left side to the right side in Gonek's conjecture given on the bottom of p.18 of
Chris Houges' slides.
are the values of (keep trying until it takes too long) VerifyGonek(T) for
T=100, T=1000, T=10000, T=100000, etc.
Added March 5 2018: Read the nice solutions .
Programs done on March 1, 2018
C13.txt ,
Contains

H(s): Eq. (15.3) (the factor needed in the Functional Equation of Zeta(s))

Z(u): the nomrmalized Zeta function for s=1/2+I*u, Eq. (15.2)

It(t,D1): Eq. (15.5)

Jt(t,D1): Eq. (15.6)

CheckP58L10(): checks Line 10 p. 58 of Iwaniec's book
Homework for March 1, 2018 (due Sunday March 4, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#13
and an attachment
hw13FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 13

Read and understand the bottom of p. 58 and top of p. 59. Explain why he set S contains a sequence {t1, ..., tR} of
Δspaced points with R ≥ T/(2Δ)

Read and try to understand the proof of Lemma 15.2, by explaining every line. (I know it is tough going!)

Write a program
CheckP59L23() ,
that checks Line 23, p. 59 of Iwaniec's book by estimating (i.e. finding an upper bound) , for large T and t, and any u, the implied constant in the O((u^2+1)/T)

Do a first reading of Chapters 16 and 17 of
H. Iwaniec's book .
Added March 5 2018: Read the nice solutions .
Programs done on March 5, 2018
C14.txt ,
Contains

H(s) 1/2*s*(1s)*Pi^(s/2)*GAMMA(s/2)

xi(s) H(s)*Zeta(s)

LogHs(s): the log. der. of H(s), H'(s)/H(s)

Y(g,s) : Eq. (17.4) in Iwaniec' book

G(g,s): Zeta(s)+g*diff(Zeta(s),s), Eq. 17.5

Check174(g,s0): checks Eq. (17.4) with G(s) and Y(s) given by (17.5) and (17.6)

Check187(s,m): the left side of (18.7) divided by the right side for any s=s0 and m

Check188(s0,j,T)
Special Homework for March 5, 2018 (due March 7, 2018, 10:00pm, In Early celebration of Pi Day)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#14Pi
and an attachment
hw14PiFirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 14Pi

Using Maple, simulate a program, Buffon(K), that approximates Pi by throwing a
Buffon needle K times.
What did you get for Buffon(1000)? Buffon(10000)?
Hint: in order to generate a random location for the (xcoordinate of the) bottom of the needle use
evalf(RandomTools[Generate](positive)):
and in order to generate a random orientation (i.e. the angle it makes with the positive xaxis) for the needle, use
evalf(RandomTools[Generate](positive)*2*Pi):
now test whether the xcoordinate of the top of the needle is either negative or larger than 1.
Now repeat this many times and find the ratio of successes, let's call it r, that should be an approximation for
2/Pi, so to estimate Pi, à la Buffon, compute 2/r.

Using the fact that binomial(2n,n)/2^(2*n) is approximately (for large n) , 1/(sqrt(n*Pi), write a Maple program
CoinTossing(n,K)
where each round consists of throwing a fair coin 2*n times, and the round is considered a susccess if there were exactly n Heads.
Let S be the number of successful rounds. Use the fact that for large n and K, S/K is approximately 1/sqrt(n*Pi), to estimate Pi.
What did you get for CoinTossing(100,10000)? Do it several times.

[Contest, prize is a Pishaped chocolate piece] Write a simulation program that is even slower than the above, i.e. find something whose probability can be expressed
in terms of Pi, simlate it, using Maple's rand(), and use it to approximate Pi, as slowly and as poorly as possible, BUT, if you had all of the time
in the world, and believe in the law of large numbers, you can get it to any desired accuracy.
Added March 8 2018: Read the nice solutions .
The cowinners of the prize (a Pishaped chocolate piece) are Yukun Yao and George Hauser.
Regular Homework for March 5, 2018 (due Sunday March 18, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#14
and an attachment
hw14FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 14
[Rephrased March 7, 2018 (thanks to Edna Jones)]

Write a procedure
Q(x,T,gL)
that inputs a real numbre x a (usually) large positive real number T and a finite list of real numberss gL and outputs
the expression, Q(x), defined in Eq. (18.12), in Professor Iwaniec's great book ,
where g_1=gL[1], g_3=gL[2], ...,

Write procedure del(s,T) defined by (18.11) and G(s,T,gL) defined by 18.10

Read Chapter 19.

Use Maple to plot a figure similar to Fig. 19.1 on p. 71.

Browse
Atle Selberg's seminal paper on the zeros of Zeta(s) on the Critical Line.
Added March 19 2018: Read the students' nice solutions .
Programs done on March 8, 2018
C15.txt ,
Contains

CFI(A,B): the nonsimple finite continued fraction with numerators B and denominators by A, see Chrystal's book p. 512, I

CFII(A,B): the nonsimple finite continued fraction with numerators B and denominators by A, with Minus signs see Chrystal's book p. 512, II

tanRat(c,d,N): the pair A,B that you get when you replace x by c/d , c,d integers (corrected by Edna Jones)

PiRat(n): rational approximations of Pi better than 22/7
Homework for March 8, 2018 (due Sunday March 18, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#15
and an attachment
hw15FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 15
Read and understand the proof that if c/d is rational then tan(c/d) is irrational, and hence Pi/4 (and hence Pi) are irrational, as proved
here .

Read and understand
Oswald Veblen's beautiful proof that Pi and e are transcendental

Use the two formulas in
Jesus Guillera's great website to write programs
JG1(N), JG2(N) that input a positive integer N and compute Pi to N decimal digits.

Use procedure AZd in the Maple package EKHAD.txt
to compute
int( x^n*(1x)^n/(1+x^2),x=0..1):
for n from 2000 to 2010.
Hint: AZd(x^n*(1x)^n/(1+x^2),x,n,N)[1] will give you a linear recurrence operator that implies a secondorder recurrence.
Program it with "option remember" and get the 2000th through 2010th terms.

Look up Machintype formulas and implement them to compute Pi.
Added March 19 2018: Read the students' nice solutions .
Programs done on March 19, 2018
C16.txt ,
Contains

CIc(f,z,C0,r): the contour integral of f of z over the circle center C0 (a complex number)
and radius r #e.g. CIr(1/z,z,0,3);

CIcN(f,z,C0,r): Numerical version of the above, using numerical integration

CIr(f,z,C0,a,b): the contour integral of f of z over the rectangle whose bottomleft corner
is the point C0=[x0,y0], and horiz. side a and vertical side b, in other words
the rectangle whose vertices are [x0,y0], [x0+a,y0],[x0+a,y0+b],[x0,y0+b]

CIrN(f,z,C0,a,b): Numerical version of the above
Homework for March 19, 2018 (due Sunday March 25, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#16
and an attachment
hw16FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 16

Wrie a procedure
CIpara(f,z,P,t,alpha,beta): that inputs a function f of a complex variable z, a pair P=[P1,P2] where P1 and P2 are functions of the real variable t, and
real numbers alpha,beta and outputs the contour integral
Int(f(z) dz, z in C from start to finish),
where C is the parametric curve x=P1(t),y=P2(t) from t=alpha to t=beta
(Hint: dz=dx+I*dy, dx=P1'(t)dt, dy=P2'(t))
Make sure that CIpara(f,z,[c0+r*cos(t),c1+r*sin(t)] ,t,0,2*Pi) gives the same output as
CIc(f,z,c0+I*c1,r) for various functions f of z

By writing a short procedure LineSegment(A,B,t) that outputs the parametric representation of a line segment joining point A=[A1,A2] and point B=[B1,B2]
from t=0 to t=1, write a procedure
CIpolygon(f,z,Polygon): that inputs a function f of a complex variable z, and a list of vertices denoting in order, the vertices of a polygon, and outputs
Int(f(z) dz, z in C from start to finish), where C is the polygon. Make sure that
CIpolygon(f,z,[[C0,C1], [C0+a,C1],[C0+a,C1+b],[C0,C1+b]] )
outputs the same as CIrN(f,z,[C0,C1], a,b) for various functions f of z.

Write a procedure
IntCauchy(L,x)
that inputs a list L of positive numbers L and computes
int(1/mul(x^2+L[i]^2,i=1..nops(L)),x=infinity..infinity) using Cauchy's residue theorem.
[Hint: Maple has a command called residue. The integral is the same as the contour integral over the contour consisting of the real axis and
the upper infinite semicircle. The answer is 2*Pi*I times the sum of the residues of the poloes of the above function in the upper halfplane.
Make sure that you get the same answer for various random lists L.

Read and understand Chapter 19 of Professor Iwaniec's great book ,

Conjecture the answer to
March 2018 Monthly Problem 12029, and if possible
prove your conjecture.

Check numerically March 2018 Monthly Problem 12031, (both parts) and if possible,
prove them.

Conjecture the answer to March 2018 Monthly Problem 12032, and if possible,
prove it, and it would be really nice if you can use procedure MultiZeil in this
amazing Maple package
[Hint, in order to use MultiZeil, you need to divide the summand by 2^n, and calling the doublesum of the problem A(n),
get a recurrence for A(n)/2^n, that easily
translates to a recurrence for A(n). Note that N is the shift operator in n, so, for example, the recurrence for Fibonacci is abbreviated
N^2N1. Once you get a recurrence, you can either do it by hand (using Discrete Math 101), or use Maple's command rsolve].
Added March 26 2018: Read the students' nice solutions .
Programs done on March 22, 2018
C17.txt ,
Contains

H(s)

xi(s) : Zeta(s)*H(s): end:

diff1(f,x,j): the jth derivative of f w.r.t. to

G(s,g): Conrey's function G(s) defined by Eq. (18.1) , where g is a finite list of [g1,g3,g5,...]

Check185(s,g): checks (18.5) for s and a list g
Homework for March 22, 2018 (due Sunday March 25, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#17
and an attachment
hw17FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 17

Write a program
Check211(S,C0,a,b)
that checks the Littlewood lemma (Eq. 21.1, p. 77), where
S is a finite set of complex numbers, C0 is a point denoting the bottomleft corner of a rectangle
whose horizonal side has length a and vertical side has length b, and taking F
to be the function of z that is the product of (zalpha) over all the members alpha of S.
You may use CIr(f,z,C0,a,b) or CIrN(f,z,C0,a,b) of C16.txt .
Test it for some examples where some membes of S lie inside the rectangle, and some don't.

Using the amazing Maple package RENE.txt,
prove Problem 12027 of March 2018 Monthly.
[Hint: Use the triangle Te(m,n), and procedures Inradius(m,n), Circumradius(Te(m,n)), Incircle(m,n)
(for the equation of the incircle), Pt to find the intersection of two lines, and Le to find the line joining two points,
DistSq (for the square of the distance between two points), and SSR(A,n,B),
with n=3, A the list of the squares of the two terms on the left, and B the right side (R/r1/2).

Test empirically Problem 12033 of March 2018 Monthly,
and if possible, prove it.
Added March 26 2018: Read the students' nice solutions .
Programs done on March 26, 2018
C18.txt
Contains

RatToCF(x): converts a pos. rational number x into a continued fraction

NuToCF(x,n): appx. a pos. number x into a continued fraction with <=n terms

EvalCF(L): evaluates the simple continued given by a list L

SymCF: the rational function of a[1], ..., a[n] describing EvalCF([a[1], ..., a[n]]):
the numerator followed by the denominator

P(a,n): The aanalog of the nth Fibonacci number, the numerator of SymCF([a[1], ..., a[n]])
Homework for March 26, 2018 (due Sunday April 1, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#18
and an attachment
hw18FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 18

Write a program
FindPeriod1(L,d)
that inputs a list L and a positive integer d and finds (if they exist), lists L1,L2,
such that L is the list L1 followed by the list L2 repeated d times, and the rest is the start of L2. For example
FindPeriod1([1,2,1,3,2,1,3,2,1,3,2,1,3], 3);
should output [1,2], [1,3,2] .

Using FindPeriod1(L,d), Write a program
FindPeriod(L)
that finds a list L1 and L2 for which there exists a d>=3 such that FindPeriod1(L,d)=[L1,L2]. For example
FindPeriod([1,2,1,3,2,1,3,2,1,3,2,1,3]) should return [1],[2,1,3]
[I thank Yukun Yao for correcting this, before I wrote [1,2],[1,3,2] that is not mininal in the prefix]

It is a famous theorem in Number Theory that every quadratic irrationality has an ultimately periodic continued fraction.
By using (make DIgits large enough) NuToCF(evalf(x),n) followed by FindPeriod(L), write a procedure
ConjCF(x)
that inputs a quadratic irrationality, and outputs lists of positive integers, L1 and L2, such that the infinite
(simple) continued fraction of x is L1 followed by L2 repeated infinitely many times.

Write a procedure
EvalPCF(L1,L2)
that inputs lists L1 and L2 (L1 may be empty) and finds the quadratic irrationality represented by it.
For example
EvalPCF([1],[2]);
should output sqrt(2)
[Hint: First write a procedure for the pureperiodic z=L2^{infinity} , using the fact that
z=EvalCF([L2,z]), solve for z, and then do EvalCF([L1,z]).

Using ConjCF(x) and EvalCF(L1,L2), write a procedure
ConjAndProveCF(x)
that has the same input and output as ConjCF(x) but now the conjectured infinite (ultimately periodic)
(simple) continued fraction is rigorously proved (or returns FAIL, if unable to prove it)

Find the L1 and L2 for all squareroots of positive integers (that are not perfect squares) from 2 to 100 (and if possible even further).
Is the sequence of lengths of the periodic part (L2) in the OEIS? What squareroot gives the largest period?
Added April 2, 2018: Read the students' nice solutions .
Programs done on March 29, 2018
C19.txt
Contains

SofS(n): the set of all the pairs [a,b], a<=b, such that a^2+b^2=n

P(L):The numerator of the (simple) continued fraction L

Q(L):The denominator of the (simple) continued fraction L

FibS(n): the set of vectors in {1,2} that addup to n

wt(s): the weight of the Fibonacci word s, product of a[j] over all intermediate stops
j that follow immediately j1
CheckQI(L,k): Checks the identity P([a1,...., an])=P([a1...,ak])*P([a(k+1)... an])+ P([a1...,a(k1)])*P([a(k+2)... an])
Homework for March 29, 2018 (due Sunday April 1, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#19
and an attachment
hw19FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 19

Write a program
SofP(n,k,r)
that inputs a positive integer n and outputs the set of tuples [a1, ..., ak] of nonnegative integers, such that
a1>=a2>=..>=ak>=0 and
a1^r+ ...+ak^r=n
Verify that SofP(n,4,2) is nonempty for all n<=1000, thereby confirming Lagrange's theorem for n <=1000.
Find the set of primes p less than 1000 for which SofP(p,3,2) is nonempty. Can you characterize it?

In preparation to Henry Smith's proof given a beautiful combinatorial formulation
here,write a program
AllCF(p)
That inputs a prime p and outputs the set of (simple) continuedfraction representation of the fractions p/a for a from 1 to (p1)/2.
Verify, for all primes less than 1000, that whenver a list shows up, its reverse also shows up.
Added April 2, 2018: Read the students' nice solutions .
Programs done on April 2, 2018
C20.txt
Contains, in addition to the contents of C18.txt and C19.txt, the following procedures

HS(p): the set of all the continued fractions of p/i for i from 2 to (p1)/2

Rev(L): the reverse of the list L

HJS(p): finding [a,b] such that p=a^2+b^2 following Henry Smith

SmithTable(N) : the list of length N of [p,[a,b]] where p=a^2+b^2 and p is 1 mod 4 for the first such primes 1 mod 4, via Henry Smith's algorithm

SmithTableF(N): Same as SmithTable(N), but done directly

[Corrected after class]
EvalCFg(A,B): evaluates the nonsimple continued fraction with numerators B and denominators A as given in
Chrystal's book (p. 512, Eq. (1))
Homework for April 2, 2018 (due Sunday April 8, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#20
and an attachment
hw20FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 20

Check the corrected version of EvalCFg(A,B) and verify that
EvalCFg([seq(a[i],i=1..n)],[1$n])
gives the same thing as
1/EvalCF([seq(a[i],i=1..n)]);
for n between 1 and 10. Also prove is in general, by looking at the definition.

Let Qg(A,B) be the denominator of EvalCFg(A,B), find the natural generalization of wt(s,a) from C19.txt, call it wtG(s,a,b), such that
Qg(A,B) is the sum of wtG(s,a,b) of all the members of FibS(n)

Let Pg(A,B) be the numerator of EvalCFg(A,B)), express it in terms of Qg(A',B') for some related lists A', B'.

Using the combinatorial interpration, find a second order recurrence satisfied by Qg(A,B)

By using Maple's
convert(tan(x),confrac,20);
find the typo in Eq. (15) (p. 522) of Chrystal's book
[Or convince me that it is not a typo, but I misunderstood the notation]

[Optional Challenge, 5 dollars to be divided among correct solutions] Define the sequence of polynomials
Pn:=(n,x)>denom(EvalCFg([seq(2*i1,i=1..n)],[x,x^2$(n1)]))
conjecture a closed form expression for the coefficient of x^k in Pn(n,x), and hence conjecture an explicit expression for Pn(n,x).
Then use this to find an expression for Qn(n,x) (the numerator), and finally prove that the limit of Qn(n,x)/Pn(n,x) as n goes to infinity, converges to tanh(x)

Write a program
Verify(a,b,c,d,e)
that empirically verifies theorem 1 of
Marcin Mazur's paper (Amer. Math. Monthly, March 2018).
Assume that the vertices of the tetrahedron are
A=[0,0,0], B=[1,0,0], C=[a,b,0], D=[c,d,e]
and hence its volume is b*e/6.

[Optional Challenge, 5 dollars to be divided among correct solutions] Prove this Theorem using Maple.

Using Maple, prove completely Proposition 2 of Marcin Mazur's paper (Amer. Math. Monthly, March 2018).
[Take A,B,C,D as above, look up the definition of the centroid, and let P be an arbitary point [p1,p2,p3]]

[Optional Challenge] Try to make sense out
Attempted proof of RH
by Nagy Adel, Mena Asham, and Marian Fady.
(received by Dr. Z.'s on April 1, 2018).
Added April 9, 2018: Read the students' nice solutions .
Programs done on April 5, 2018
C21.txt
[courtsey of Edna Jones. I lost the original file]
Contains

EvalCFg(A, B): evaluates a general continued fraction with numerators B and denominators A

Tanh(n,x): the truncated continued fraction from Chrystal for tanh(x)

FWB(n,x,p): the truncated continued fraction replacing 2*j1 in tanh(x) by a general function so Tanh(n,x) is FWB(n,x,k>2*k1).

PadeExp(f,x,m,n): inputs a function f of the variable x and nonnegative integers m and n outputs a rational function of exp(x) with
numerator of at most m and denominator of at most n such that the firs m+n1 Taylor coefficients of fMyPade(f,x,m,n) are zero

[added after class] FWBg(n,x,y,p): Like FWB(n,x,p) by replacing x^2 by y
Homework for April 5, 2018 (due Sunday April 8, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#21
and an attachment
hw21FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 21

y(x)=tanh(x) happens to satisfy the differential equation y'(x)=y(x)^21
Write a program
GuessODE(f,x,N,k,y)
that inputs a function f, or the the start of a Taylor series, in x, a positive integer N, a positive integer k, and a letter y, and
outputs a polynomial in y, of degree k, such that f satisfies the ode
f'(x)=P(f(x)),
up to the Nth Taylor coefficient (and hopefully for ever).
For example
GuessODE(tanh(x),x,20,2,y) ;
should return y^21 .

Using procedure
FWBg(n,x,y,p)
added in C21.txt after class
(FWBg(n,x,x^2,j>2*j1) gives tanh(x)), define the family of polynomials (depending on the integer parameters a and b)
P_{n}(x,y) = numer(FWBg(n,x,y,j>a*j+b))
Q_{n}(x,y) = denom(FWBg(n,x,y,j>a*j+b))
to form the sequence consisting of the first, say, 30, terms of each , and use procedure
Findrec(Sequence,n,N,C)
(with C=7)
in the Maple package Findrec.txt
to find the recurrences satisfied by these for various choices of a, and b. Can you
conjecture a form for the recurrence(s) in terms of a and b?
Added April 9, 2018: Read the students' nice solutions .
Programs done on April 9, 2018
C22.txt
Contains

ZNt(N,t):zeta_N(1/2+I*t)*zeta_N(1/2I*t), where Zeta_N(s) is the truncated Zeta function

ZNtR(N,t): more efficient version, only using realvalued functions

FindIC(f,t,T,res): inputs a nonnegative function f of t, and a pos. nunber T
and a resolution, and finds appx. minima

OneS(f,t,t0): applies one step of the NewtonRaphson method
RN(f,t,t0,N,err): estimates the closest zero of f of t to t0 as soon as two consecutive
iterations are less than err apart, or we reached N iterations and return FAIL
Homework for April 9, 2018 (due Sunday April 15, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#22
and an attachment
hw22FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 22
The rest of the homework, for this semester, will be working on the two class projects, where the templates are
Truncated Zeta Project
and Random Polygon Project.
Soon we will divied the labor and get organized, but meanwhile please do all the problems below, that
eventualy will be part of the class' papers.

For the truncated Zeta project, finish what we did in class and write a program
TrunZetaMinima(N,T,err),
that inputs a positive integer N, a large real number T, and a small error, (positive real number), and outputs the list
of all pairs [location, value] where location is a local minimum of ZNtR(N,t), and value is its value there.
Try to generated as much data as possible.
[Added April 12, 2018: we did this one in C23.txt, so it is officially optional now (of course, you can make it better)]

For the random polygon project, get a feel for it, by

Writing a procedure
RandomGoodPoly(n)
that inputs a positive integer and outputs a random polygon with n vertices, whose centroid is the origin.
Hint: generate two random vectors, x and y, and substract from them their averages, also call these new vectors x and y
to make their sum to zero and let the
polygon be [[x1,y1], ..., [xn,yn],[x1,y1]]

Write a procedure
AvePolygon(P)
that inputs a polygon, (given by its list of vertices), and outputs the polygon whose vertices are the midpoints of the edges.

Write a procedure
IterPolygon(n,N)
that inputs a RandomGoodPoly(n) and a large pos. integer N, and performs AvePolygon(P) N times, and also plots it
(use the command plot(P)). Perform IterPolygon(20,200) many times and look at the picture.

[Challenge (no peeking in the internet)] Explain why this (limiting) pattern happens.
Added April 16, 2018: Read the students' nice solutions .
Programs done on April 12, 2018
C23.txt
Contains

Z(N,t): Zeta_N(1/2+I*t)*Zeta_N(1/2I*t) where Z_N(s)=1+1/2^s+ ...+N^s, in floating point

Ze(N,t): Zeta_N(1/2+I*t)*Zeta_N(1/2I*t) where Z_N(s)=1+1/2^s+ ...+N^s Exactly (unevaluated)

FindAZ(f,t,T,res): inputs a function f of t, a pos. integer T, and a pixelsize res
and finds all the intervals [res*(i1),res*i] where f changes sign

OS(f,t,P): inputs a function f t and an interval P where the sign of f is opposite
and outputs the left or right interval with the same property

ZI(f,t,P,eps): inputs f,t,P, finds an approximation to the zero of f in P

FindZ(f,t,T,res,eps): inputs a function f of t, a pos. integer T, and a pixelsize, res,
and an error eps, and outputs (hopefully) all the approximate zeros in [0,T]
Homework for April 12, 2018 (due Sunday April 15, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#23
and an attachment
hw23FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 23

Write a program
GlobalMinimumZN(N,T)
that inputs a positive integer N and a large positive integer T, and outputs the location and value of the
global minimum of Z(N,t) in 0<=t<=T
What are GlobalMinimumZN(N,1000) for N from 2 to 10?

Write a program
GlobalMaximumZN(N,T)
that inputs a positive integer N and a large positive integer T, and outputs the location and value of the
global maximum of Z(N,t) in 0<=t<=T
What are GlobalMaximumZN(N,1000) for N from 2 to 10?
Added April 16, 2018: Read the students' nice solutions .
Programs done on April 16, 2018 (virtual class)
C24.txt

IterPolygon(n,N): (written by Yukun Yao, taken from his hw22.txt) inputs a positive integer n,
and a positive integer N, starts out with a random nsided polygon with centroid at the origin,
and keeps taking midpoints of adjacent vertices to form a new polygon, doing it N times.

MtV(M,V): Multiplies a matrix M (given as a list of lists) and a compatible columnvector V (given as a list)

LCdet(M): the determinant of the squarematrix M, using the method of Alice in Wonderland's creator
(nicely proved here

RandM(m,n,N): a randim m by n matrix (given as a list of lists) whose entries are between 1 and N

ChM(M,x): Mx*I (as a list of lists)

ChP(M,x):the characteristic matrix of the square matrix M, w.r.t the variable x, i.e. MIx

EV(M,eps): the list of eigenvalues of the square matrix M, and decreasing order of their absolute values. eps is a small parameter,
just for convenience

EVC(M): inputs a square matrix M, given as a list of lists,
and outputs the list of eigenvalues (in weaklydecreasing order of absolute value)
and the respective UNIT eigenvectors, all in floating point.

EVCm(M): does the same as EVC(M) BUT using Maple's builtin linalg package (I like it better than LinearAlgebra), but
the eigenvalues are not sorted and the eigenvectors are not normalized to be unit
Homework for April 16, 2018 (due Wed. April 18, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#24
and an attachment
hw24FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 24

Finish up EVCm(M) so that it will coincide with EVC(M), in other words, sort the list of eigenvalues into
a weaklydecreasing list (by absolute value), and make all eigenvectors unit. Of course the eigenvectors should correspond
to the respective eigenvalues.

Write a procedure
Coeffs(V,M)
that inputs a vector V (given as a list, of size n, say) and a list of vectors M (of the same size of V), and outputs the
list a[1], ..., a[n] such that
V=a[1]*M[1]+ ...+ a[n]*M[n]
In other words express V as a linear combination of the vectors M[1], ..., M[n]
[Hint: you can either use solve, or matrix inversion, using inverse(M) and the procedure MtV(M,V) created today]

Write a procedure, A(n), that inputs a positive integer n, and outputs the n by n matrix
(given as a list of lists), corresponding to the "averaging process"
[x1,x2, ..., xn] >[(x1+x2)/2, (x2+x3)/2, ...., (xn+x1)/2]
Added April 18, 2018: Read the students' nice solutions .
Programs done on April 19, 2018 (virtual class)
C25.txt
Contains procedures
Homework for April 19, 2018 (due Sun. April 22, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#25
and an attachment
hw25FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 24

Prove that 1 is the an eignenvalue of A(n) and the all 1 vector is an eigenvector

[Added April 20,2018] plot the eigenvectors corresponding to the secondandthird largest (i.e. the largest ones that complex)
eigenvetors of A(n) for n=30. Recall that its components are complex numbers and the complex number x+y*I corresponds to
the point [x,y]. What kind of shape emerges? can you conjecture an equation for it?

[Possibly a challenge] Explain why the limiting shape is an elliplse
[
Added April 21, 2018: previously I claimed that the inclination is 45 degrees, that was wrong. The inclination can be anything.
The shape is an ellipse whose center is the origin, of course, but otherwise can be any shape and any orientation]

Write a program that inputs a good polygon and outputs the eccentricity
[Added April 21, 2018: and orientation]
of the limiting ellipe, by just using the initial points of the polygon
(i.e. the vector of xcoordinates and the vector of ycoordiates, both of which addup to 0).
[Correction April 21, previously I said "add up to 1", of course that was wrong, by construction of a good polygon the
x and y bectors add up to 0]
Hints: (1) use Coeffs (2) Convince yourself that if A and B are any complex numbers, the curve
x=Real(A*exp(I*t)), y=Real(B*exp(I*t))
is an ellipse. By writing A=A*exp(I*arg(A)) and B=B*exp(I*arg(B)), can you find the eccentricity and orienation of that ellise?

[Challenge, 10 dollars to be divided; Added April 23, 2018: this prize was shared by Edna Jones and Ahsan Khan]
Using experimentation, or otherwise,
find an explicit expression, in terms of w:=exp(2*Pi*I/n), for the two largest eigenvalues of A(n) (they are complexconjugates of each other) and
if possible for the corresponding eigenvectors (they are also complext conjuates of each other).
Added April 23, 2018: Read the students' nice solutions .
Programs done on April 23, 2018

C25a.txt finishing up the iterated polygon. This was renamed
IteratedPolygon.txt finishing up the iterated polygon, and
will be hopefully expanded into an impressive Maple package for the Iterated Polygon class project.

C26.txt , a Maple oneline proof of the moudular functional equation for
the theta function, following George Polya's beautiful elementary proof,
but letting Maple automatically do all the limits.
Homework for April 23, 2018 (due Sun. April 29, 2018, 10:00pm)
Please email ShaloshBEkhad at gmail dot com an email with
Subject: hw#26
and an attachment
hw26FirstNameLastName.txt
and indicate whether it is OK to post.
#YourName, Math 640 (Spring 2018) homework assignment 24

Find a typo in Bellman's account of
George Polya's beautiful elementary proof

[Challenge] figure out if and when the 45 degrees orientation holds, claimed by Van Loan in this
chariming article .

[Challenge, I don't know the answer]
Try to use
Polya's brilliant idea
of using an algebraic identity, lsecting it, pluggingin values and taking the limit, may yield other
continuous, and who knows?, new, identitites.
For example, start with the trinomial theorem (1/z+1+z)^(3*m).

Work as hard as you can on the class projects
Truncated Zeta
and Iterated polygon
that you belong to (but feel free to contribute to the other one, if you will contribute significantly, the
leader will add your name).
[The leaders (Yukun Yao and Matt Charnley) should copy these pages, and the package to their own website, and at the very end, send them to me for posting]
Programs done on April 26, 2018
C27.txt
Contains, in addition to those of C23.txt, procedurs

DioA(a,eps): the best (i.e. least denominator) appx. of a by a rational number with error

LogRat(n,eps): The rational appx. of log(n) with error

ZeRat(N,t,eps): the rational appx. to Ze(N,t) with error (of the log(n))
Homework for April 26, 2018 (due Tuesday, May 1)
Have the templates and the very preliminary versions in the respective leaders' websites the
following fronts of the two projects
Coordinate who will do what. The leaders will assemble all the pieces, and write a first draft of the papers and the
Maple packages, that the team members can modify. It would be nice to have something postable by
Aug. 31, 2018.
Programs done on April 30, 2018
C28.txt
Today we were getting ready for the field trip to the Princeton Cemetery (May 1, 2018) , by highlighting the
work of some of the geniuses that we will visit.
Contains,

VN(A,x,y): inputs a matrix A , m by n say, where player Row has
m different strategies and player Column has n different strategies
and the payoffs are A[m][n] and A[m][n], respectively. Outputs the expected
gain for Row (alias minus expected gain for Column) if they play a mixed strategy x and y

VN2(A,x,y): the payoffs for 2 by 2 matrix and strategies [x,1x], [y,1y]

RP(n): a random point in [0,1]^n

RD(n): a random distance between 2 points in the ndim unit cube

MC(n,N): the average of the distances between two random points in [0,1]^n done N times

RC3(): The value of the Robbins constant as a triple integral

RC3e(): The excact value of the Robbins constant (due to David Robbins)

RC2(): the exact value of the 2dim Robbins constant

RC44(): the exact value of the 4dim Robbins constant
Optional Homework for April 30, 2018 (due whenever you feel like it)
[Please send it to DoronZeil@gmail.com rather than ShaloshBEkhad@gmail.com]

Implement, in Maple, the CooleyTukey.
Compare its speed to the naive way of finding the Discrete Fourier Transform.
Added June 15, 2018: See the
amazing paper
by Yonah BiersAriel, Matthew Charnley, Brooke Logan, Anthony Zaleski and Dr. Z. that
came out from one of the two group projects.
Added Jan. 29, 2019: See the amazing Maple package
/TruncatedRiemannZeta.txt
by Edna Jones and Yukun Yao.
For beatiful pictures and data visit
webpage of Truncated Riemann Zeta function project.