> #Weiji Zheng, Homework 24, 12/11/2020 ; > #OK TO POST HOMEWORK ; > ; > #Q1 ; > #(i) How many (integer) partitions are there of 97 where the each part, upon division by 7, gives remainder in the set {1,4,5}? > #(ii) How many (integer) partitions are there of 97 where the the difference between consecutive parts is at least 3? > ; > ; > #pnC(97, {1, 4, 5}, 7) > #108236 ; > #pnD(97, 3) > #19990 ; > #Q2 ; > #Write a joint generalization of procedures pnD(n,d) and pnC(n,C,m) in M24.txt, call it > #pnDC(n,d,C,m) > > #that inputs a positive integer n, a non-negative integer d, a set C that is a subset of {0,..., m-1} and a positive integer m and outputs the #NUMBER of partitions of n such that the difference of two consecutive entries is at least d, and each entry mod m belongs to C. > > #(i) Check that pnDC(n,0,C,m) gives the same output as pnC(n,C,m) and pnDC(n,d,{0},1) give the same output as pnD(n,d) > > #(ii) Use it to find the first 40 terms of the sequence enumerating partitions that are both odd and distinct. Is it in the OEIS? If it is, What #is the A-number? > > #(iii) Use it to find the first 40 terms of the sequence enumerating partitions such that the difference between consecutive entries is at least #2, and each entry gives remainder 1 or 4 when divided by 5. Is it in the OEIS? If it is, What is the A-number? > ; > ; > pnkCJD:=proc(n,d,k,C,m) local L,S: > option remember: > if k > n then > RETURN(0): > fi: > if k = n then > if member(k mod m, C) then > RETURN(1): > else > RETURN(0): > fi: > fi: > if n = 1 then > if member(1, C) then > RETURN(1): > else > RETURN(0): > fi: > fi: > if not member(k mod m, C) then > RETURN(0): > fi: > > S := 0: > for L to k-d do > if member(L mod m, C) then > S := S + pnkCJD(n-k, d, L, C, m): > fi: > od: > > S: > > end: > pnDC := proc(n,d,C,m) local k: > add(pnkCJD(n,d,k,c,M),k=1..n): > end: > #(1) #check ; > #pnDC(20, 0, {1, 2}, 2) = pnC(20, {1, 2}, 2) ; > ; > #pnDC(20, 2, {0}, 1) = pnD(20, 2) ; > ; > ; > #(2) ; > #seq(pnDC(i, 1, {1}, 2), i = 1 .. 40) > #1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 7, 8, 8, 9, 11, 12, 12, 14, 16, 17, 18, 20, 23, 25, 26, 29, 33, 35, 37, 41, 46 ; > #A000700 ; > #Expansion of Product_{k>=0} (1 + x^(2k+1)); number of partitions of n into distinct odd parts; number of self-conjugate partitions; number of symmetric Ferrers graphs with n nodes. ; > #(3) ; > #seq(pnDC(i, 2, {1, 4}, 5), i = 1 .. 40) > #1, 0, 0, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 2, 3, 3, 2, 2, 3, 5, 5, 3, 3, 5, 7, 7, 6, 5, 7, 11, 11, 8, 8, 12, 15, 15, 13, 12, 16, 22 ; > #A203776 Number of partitions of n into distinct parts 5k+1 or 5k+4. ; > ; > #Q3 ; > #Use the argument in the lecture that proved that the generating function of p(n) is > #1/((1-q)*(1-q^2)*(1-q^3)*....) > > #To prove that the generating function of the sequence enumerating distinct partitions is > > #(1+q)*(1+q^2)*(1+q^3)*... =Product(1+q^i,i=1..infinity) ; > ; > ; > #Q4 ; > #Use this time of argument to prove that the generating function of the sequence enumerating odd partitions (i.e. partitions whose components are all odd) is > #1/((1-q)*(1-q^3)*(1-q^5)*....)=Product(1/(1-q^(2*i+1),i=0..infinity) ; > ; > ; > #Q5 ; > #By combining the above two problems, prove Euler's theorem that for every n, the number of partitions of n into odd parts, equals the number of partitions of n into distinct parts. ;