Ok to post! Thanks for the extension Dr. Z Question 1 (i) The number of 10-letter words in the alphabet {1,4,6} that add-up to 201 There are no 10 letter words in the alphabet that add up to 201 (ii) The number of words in the alphabet {2,3,7} of ANY length, that add-up to 411 - (iii) The number of sequenes of any length whose entries are either 1 (mod 5) or 4 (mod 5) and that add up to 341 Question 2: Using the convention of representing partitions as weakly-decreasing sequences, write a procedure, call it Pnk(n,k) that inputs non-negative integers n and k and outputs the SET of all partitions of n whose LARGET part is k. Pnk:=proc(n,k) local ans, W, w, i: option remember: if n < 0 or k < 0 then RETURN(FAIL): fi: if n = 0 and k = 0 then return {[]}: fi: if k > n then return {}: fi: ans := {}: W := {}: for i from 0 to k do W := W union Pnk(n-k,i): end: ans := {seq([k,op(w)], w in W)}: end: Question 3: Count the numbers: Pnk:=proc(n,k) local ans: option remember: if n < 0 or k < 0 then RETURN(FAIL): fi: if n = 0 and k = 0 then return 1: fi: if k > n then return 0: fi: ans := {}: W := {}: for i from 0 to k do ans := ans+ Pnk(n-k,i): end: ans: end: Question 4: pn:=proc(n) local ans, i: if n <= 0 then RETURN(FAIL): fi: ans:= 0: while i < n do ans := ans+pnk(n,i): i:=i+1 end: ans end: Sequence generated: 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 OEIS Number A41 Question 5: [seq(pn(5*n + 4) mod 5, n = 1 .. 50)]; [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [seq(pn(7*n + 5) mod 7, n = 1 .. 50)]; [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [seq(pn(11*n + 6) mod 11, n = 1 .. 50)] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]