#C26.txt, April 25, 2016, Writing a computer-generated paper #about Ramanujan-style congruences Help:=proc(): print(`SeqR(r,s,N), GenPaper(R,S,N,N1), GenPaperG(R1,R2,S1,S2,N,N1)`): end: #stuff from C25.txt: Getting ready for the Ramanujan movie, April 21, 2016 Help25:=proc(): print(`SeqPSS(N), SeqPS(N), p(n) , SeqP(N) , FindRC(L) `): end: with(combinat): with(numtheory): #SeqPSS(N): A super stupid (very slow) program to output the first #N terms (starting at n=1) of the number of integer-partitions of n SeqPSS:=proc(N) local i: [seq(nops(partition(i)),i=1..N)]: end: #SeqPS(N): A little stupid (less slow) program to output the first #N terms (starting at n=1) of the number of integer-partitions of n #using Leonhard Euler's generating function #Sum(p(n)*q^n,n=0..infinity)=1/mul(1-q^i,i=1..infinity) SeqPS:=proc(N) local i,f,q: f:= taylor(1/mul(1-q^i,i=1..N), q=0, N+1): [seq( coeff(f,q,i),i=1..N)]: end: #p(n): the number of partitions of n, using Euler's recurrence given a beautiful #combinatorial proof by David Bressoud and Dr. Z. #p(n)=p(n-1)+p(n-2) +...- (-1)^j* ( p(n-j*(3*j+1)/2) + p(n-j*(3*j-1)/2) )+... p:=proc(n) local j,su: option remember: if n<0 then RETURN(0): elif n=0 then RETURN(1): else su:=0: for j from 1 while j*(3*j-1)/2 <=n do su:= su+ (-1)^(j+1)* ( p(n-j*(3*j+1)/2) + p(n-j*(3*j-1)/2) ) : od: RETURN(su): fi: end: #SeqP(N): A clever program to output the first #N terms (starting at n=1) of the number of integer-partitions of n #using Leonhard Euler's recurrence SeqP:=proc(N) local n: [seq( p(n),n=1..N)]: end: #FindRC(L,s): Inputs a sequence of integers #L, all the Ramaujan congruences inspired by # p(5*n+4) == 0 mod 5, of the form #L [prime*n + j] == 0 mod prime for prime nops(L)/20 #The output is the set [prime,j] with that property #execept when prime divides s or the prime is 2 FindRC:=proc(L,s) local p1,S,j,i: p1:=2: S:=[]: while p1<=nops(L)/20 do if not type(s/p1,integer) and p1<>2 then for j from 0 to p1-1 do if {seq(L[p1*i+j] mod p1 ,i=1..(nops(L)-j)/p1)}={0} then S:=[op(S), [p1,j]]: fi: od: fi: p1:=nextprime(p1): od: S: end: #end C25.txt #SeqR(r,s,N): the first N terms in the sequence of coefficients of #((1+q)*(1+q^2)*...)^r/((1-q)*(1-q^2)*...)^s #and then conjectures Ramanujan-style congruences #written by John Chiarelli SeqR:=proc(r,s,N) local f,Body,JC: f:=taylor(mul(1+q^i,i=1..N)^r/mul(1-q^i,i=1..N)^s,q=0,N+1): Body:=[seq(coeff(f,q,i),i=1..N)]: FindRC(Body,gcd(r,s)): end: #GenPaper(R,S,N,N1): inputs positive integers R, and S, and a large #positive integer N, and a not so large positive integer N1, outputs a paper ready for submission #about Ramanujan-style congruence miracles, that contains the relevant integer sequence with N1 terms GenPaper:=proc(R,S,N,N1) local L,i,p,q,c,r,s,co, f, p1,j1,emily ,n,n1: print(`Lots and Lots of Ramanujan-Style Congruence miracles and Lots and Lots`): print(`of new Integer Sequences for the OEIS`): print(``): print(`By John Chiarelli, Rebecca Coulson, Bryan Ek, Keith Frankston, Alejandro Ginory,`): print(` Emily Kukura, Andrew Lohr, Jinyoung Park, Ali Rostami, Xukai Yan, Mingjia Yang`): print(`and Anthony Zaleski `): print(``): print(`Recall that p(n) is the number of integer-patitions of the integer n`): print(`Leohanrd Euler famously proved that these are the coefficients of`): print(``): print(Product(1/(1-q^i),i=1..infinity)); print(``): print(`Srinivasa Ramanujan famously proved that `): print(p(5*n+4)/5, p(7*n+5)/7, p(11*n+6)/11 ): print(`are all integers. These integer sequences are already in the OEIS.`): print(`These amazing facts also led to the question, first raised by `): print(`Freeman Dyson, to give combinatorial explanations. This was answered `): print(`by Frank Garvan, and George Andrews. `): print(``): print(`In this article we will state many new such congruences for the more general`): print(`sequences defined by `): print(``): print(Product((1+q^i)^r/(1-q^i)^s,i=1..infinity)); print(``): print(`for r from 0 to `, R, `and for s from 0 to`, S, `except the trivial case r=s=0`): print(`and also supply the first`, N1, `terms of many new sequences for the OEIS.`): print(``): print(`Each theorem also raises an intriguing challenge to prove it combinatorially`): print(`by finding a way to partition the counted set into subsets with the same cardinality.`): print(``): print(`Let's call`, c[r,s](n), `the coefficient of`, q^n, `in this product. `): print(``): print(`Note that these also have natural combinatorial meanings. For example`): print(`The case r=1, s=1 counts so-called overpartitions.`): print(``): print(`We don't bother with the proofs, since for the case r=0 it was shown by `): print(`Dennis Eichhorn and Ken Ono, in their interesting paper`): print(` Congruences for partition functions`): print(` Proceedings for a Conference in Honor of Heini Halbertstam 1, 1996, pp, 309-321`): print(`available from http://www.mathcs.emory.edu/~ono/publications-cv/pdfs/013.pdf `): print(`that one can easily determine an N_0 such that the theorem is true if it is checked`): print(`for n<=N0. It turns out that the N_0 are usually rather small, and since we check it`): print(`for many values of n, and we know that there exists a rigorous proof, we don't bother`): print(`to actually prove it.`): co:=0: for r from 0 to R do for s from 0 to S do if r+s>0 then L:=SeqR(r,s,N): for f in L do p1:=f[1]: j1:=f[2]: co:=co+1: print(`Theorem Number `, co , ` Let `, c[r,s](n), `be the coefficient of` , q^n): print(`in the power series of `): print(``): print(Product((1+q^i)^r/(1-q^i)^s,i=1..infinity)); print(``): print(`Then `, c[r,s]( n*p1 + j1)/p1 , `is always an integer ` ): print(``): print(`For the sake of our beloved OEIS, here are the first coefficients`): emily:=taylor(mul(1+q^i,i=1..N)^r/mul(1-q^i,i=1..N)^s,q=0,N+1): print(seq(coeff(emily,q,n1*p1+j1)/p1 ,n1=0..min(N1-1,trunc((N-j1)/p1)))): od: fi: od: od: print(`This ends this article, that took`, time(), `seconds to produce. `): end: #GenPaperG(R1,R2,S1,S2,N,N1): Added April 27, 2016 generalizing GenPaper #inputs positive integers R1, R2, and S1,and S2 and a large #positive integer N, and a not so large positive integer N1, outputs a paper ready for submission #about Ramanujan-style congruence miracles, that contains the relevant integer sequence with N1 terms #it is about the coefficients of Product((1+q^i)^r/(1-q^i)^s,i=1..infinity) for r from R1 to R2 and s from S1 to Se GenPaperG:=proc(R1,R2,S1,S2,N,N1) local L,i,p,q,c,r,s,co, f, p1,j1,emily ,n,n1: print(`Lots and Lots of Ramanujan-Style Congruence miracles and Lots and Lots`): print(`of new Integer Sequences for the OEIS`): print(``): print(`By John Chiarelli, Rebecca Coulson, Bryan Ek, Keith Frankston, Alejandro Ginory,`): print(` Emily Kukura, Andrew Lohr, Jinyoung Park, Ali Rostami, Xukai Yan, Mingjia Yang`): print(`and Anthony Zaleski `): print(``): print(`Recall that p(n) is the number of integer-patitions of the integer n`): print(`Leohanrd Euler famously proved that these are the coefficients of`): print(``): print(Product(1/(1-q^i),i=1..infinity)); print(``): print(`Srinivasa Ramanujan famously proved that `): print(p(5*n+4)/5, p(7*n+5)/7, p(11*n+6)/11 ): print(`are all integers. These integer sequences are already in the OEIS.`): print(`These amazing facts also led to the question, first raised by `): print(`Freeman Dyson, to give combinatorial explanations. This was answered `): print(`by Frank Garvan, and George Andrews. `): print(``): print(`In this article we will state many new such congruences for the more general`): print(`sequences defined by `): print(``): print(Product((1+q^i)^r/(1-q^i)^s,i=1..infinity)); print(``): print(`for r from` , R1, ` to `, R2, `and for s from`, S1, `to `, S2, `except the trivial case r=s=0`): print(`and also supply the first`, N1, `terms of many new sequences for the OEIS.`): print(``): print(`Each theorem also raises an intriguing challenge to prove it combinatorially`): print(`by finding a way to partition the counted set into subsets with the same cardinality.`): print(``): print(`Let's call`, c[r,s](n), `the coefficient of`, q^n, `in this product. `): print(``): print(`Note that these also have natural combinatorial meanings. For example`): print(`The case r=1, s=1 counts so-called overpartitions.`): print(``): print(`We don't bother with the proofs, since for the case r=0 it was shown by `): print(`Dennis Eichhorn and Ken Ono, in their interesting paper`): print(` Congruences for partition functions`): print(` Proceedings for a Conference in Honor of Heini Halbertstam 1, 1996, pp, 309-321`): print(`available from http://www.mathcs.emory.edu/~ono/publications-cv/pdfs/013.pdf `): print(`that one can easily determine an N_0 such that the theorem is true if it is checked`): print(`for n<=N0. It turns out that the N_0 are usually rather small, and since we check it`): print(`for many values of n, and we know that there exists a rigorous proof, we don't bother`): print(`to actually prove it.`): co:=0: for r from R1 to R2 do for s from S1 to S2 do if r+s>0 then L:=SeqR(r,s,N): for f in L do p1:=f[1]: j1:=f[2]: co:=co+1: print(`Theorem Number `, co , ` Let `, c[r,s](n), `be the coefficient of` , q^n): print(`in the power series of `): print(``): print(Product((1+q^i)^r/(1-q^i)^s,i=1..infinity)); print(``): print(`Then `, c[r,s]( n*p1 + j1)/p1 , `is always an integer ` ): print(``): print(`For the sake of our beloved OEIS, here are the first coefficients`): emily:=taylor(mul(1+q^i,i=1..N)^r/mul(1-q^i,i=1..N)^s,q=0,N+1): print(seq(coeff(emily,q,n1*p1+j1)/p1 ,n1=0..min(N1-1,trunc((N-j1)/p1)))): od: fi: od: od: print(`This ends this article, that took`, time(), `seconds to produce. `): end: