Question 1 a) How many (integer) partitions are there of 97 where the each part, upon division by 7, gives remainder in the set {1,4,5}? b) How many (integer) partitions are there of 97 where the the difference between consecutive parts is at least 3? Answer 1 a) We find this by doing pnC(97, {1, 4, 5}, 7) We get 108236 b) We find this by doing pnD(97, 3) We get 108236 Question 2 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? Answer 2 We use dynamical programming to do this pnkDC:=proc(n,k,d,C,m) local i, S: option remember: if k > n or not member(k mod m, C) then return 0: fi: if k = n and member(k mod m, C) then return 1: fi: S:=0: for i from 1 to k-d do S:=S+pnkDC(n-k,i,d,C,m): end: S: end proc: pnDC:=proc(n,d,C,m) local i: add(pnkDC(n,i,d,C,m), i = 1..n): end: 1) After checking for various n's they do give the same answer 2) seq(pnDC(n, 1, {1}, 2), n=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 It is in the OEIS as A700 3) seq(pnDC(n, 2, {1,4}, 5), n=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 It is in the OEIS. A203776 Question 3: [Human Exercise] 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) Answer 3 Question 4 [Human Exercise] 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) Answer 4