#its ok to post #TaerimKim,10/4/2020,Assignment 8 #1. #(i). equivalent to the CompsGFk statement that coefficient of x^201 for S={1,4,6} with k=10. coeff(CompsGFk({1, 4, 6}, x, 10), x, 201); 0 #indicates that it does not exist. #(ii). equivalent to the statement that coefficient of x^411 for S={2,3,7} GFseq(CompsGF({2, 3, 7}, x), x, 411)[412]; 4741685087960650685822461715671211099459856575685906645393 #(iii). By using the CompsGFcon GFseq(CompsGFcon(5, {1, 4}, x), x, 341)[342]; 234303065886413369536085349033389448858104244347193374824719 ################################################################# #2. #Finally, I managed to do this Pnk := proc(n, k) local a, A: option remember if n = 0 then return {[n]}; fi: if k<0 or n<0 then return fail fi: if k>n then return {} fi: if k=n then return k fi: A:={seq(seq([k, op(a)], a in Pnk(n - k, i)), i = 1 .. k)}: end: ##examples Pnk(5, 2); {[2, 2, 1], [2, 1, 1, 1]} Pnk(9, 3); {[3, 3, 3], [3, 2, 2, 2], [3, 3, 2, 1], [3, 2, 2, 1, 1], [3, 3, 1, 1, 1], [3, 2, 1, 1, 1, 1], [3, 1, 1, 1, 1, 1, 1]} ################################################################# #3. pnk := proc(n, k) local B: option remember if k<0 or n<0 then return fail fi: B:=nops(Pnk(n,k)): end: #example pnk(5, 2); 2 pnk(9, 3); 7 ################################################################# #4. pn:=proc(n) local C: option remember if n = 0 then return 1; fi: if n<0 then return fail fi: C := add(pnk(n, i), i = 1 .. n) end: #for the given sequence seq(pn(n), n = 0 .. 30); 1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604 #this is the sequence for the partition numbers, labeled as A000041 ################################################################# #5. the original statement takes way too much of a time to process, so i will break it down [seq(pn(5*n + 4), n = 1 .. 10)]; #n til 10 initially and above n=10, it will be impossible to calculate due to its big numbers [30, 135, 490, 1575, 4565, 12310, 31185, 75175, 173525, 386155] #from here we know that pn(5n+4) is all factored by 5 so we can deduce that pn(4n+4) mod 5 will generate 0's #So #[seq(pn(5*n+4) mod 5, n=1..50)] #=[0,0,0,0,..,0] #next, [seq(pn(7*n + 5), n = 0 .. 5)]; [7, 77, 490, 2436, 10143, 37338] % mod 7; [0, 0, 0, 0, 0, 0] #for n from 0 to 5, we see similar patterns so we can deduce that #[seq(pn(7*n+5) mod 7, n=1..50)] #=[0,0,0,0,..,0] #last, [seq(pn(11*n + 6), n = 0 .. 3)]; [11, 297, 3718, 31185] % mod 11; [0, 0, 0, 0] #Again, #[seq(pn(11*n+6) mod 11, n=1..50)] #=[0,0,0,0,..,0] ########################################################################### #6. This is called "Ramanujan's congruences" and traced its origin through paper"An elementary proof of p(11m+6)¡Õ0 (mod 11)" by Lasse Winquist (https://www.sciencedirect.com/science/article/pii/S0021980069801055). #mathematician Srinivasa Ramanujan discovered the congruences in his 1919 paper, "Congruence properties of partitions"(https://zenodo.org/record/1447425#.X3uGl8JKhEY).