#Ok to post homework #Tifany Tong, December 13th, 2020, HW #25 # 1.) # [9,6,5,3,1,1,1] # Ferrers Diagram: # ********* # ****** # ***** # *** # * # * # * # Conjugate Partition: [7,4,4,3,3,2,1,1,1] # 2.) pnk(151,10) = 79811865 # 3.) [[6,5,3,1,1,1,1,1],-1] # 6-3(-1)-8-1 = 6+3-9 = 0 # -1+1 = 0 # [[6,3,2,2,2,2,2],0] = BZ([[6,5,3,1,1,1,1,1],-1]) # 4.) # pnFast(10000); # 36167251325636293988820471890953695495016030339315650422081868605887952568754066420592310556052906916435144 # [seq(pnFast(i), i = 1 .. 10000)][10000]; # 36167251325636293988820471890953695495016030339315650422081868605887952568754066420592310556052906916435144 # pnFast(20000); # 252114813812529697916619533230470452281328949601811593436850314108034284423801564956623970731689824369192324789351994903016411826230578166735959242113097 # [seq(pnFast(i), i = 1 .. 20000)][20000]; # 252114813812529697916619533230470452281328949601811593436850314108034284423801564956623970731689824369192324789351994903016411826230578166735959242113097 # It can cache the previous results as all the previous results have to be calculated with the seq command before approaching the final value. # 5.) pnFastMod := proc(n, m) local i: return [seq(pnFast(i), i = 1 .. n)][n] mod m: end: # pnFastMod(10^5, 101) = 89 # 6.) with(ListTools): check := proc(L) local i, ans: for i from 2 to nops(L) do if L[i] = L[i - 1] then return false: fi: od: return true: end: InvGlashier := proc(L) local i, curr1, curr2, curr3, curr, co: co := L: while check(co) = false do for i from 2 to nops(co) do if co[i] = co[i - 1] then curr1 := [op(co[1 .. i - 2])]: curr2 := [op(curr1), 2*co[i]]: curr3 := [op(curr2), co[i + 1 .. nops(co)]]: curr3 := Flatten(curr3): co := sort(curr3, `>`): break: fi: od: od: return sort(co): end: # With this maple code I am able to get InvGlashier(Glashier(sort(L))) = sort(L). # 7.) InvSyl := proc(L) local i, r, m, L1, M1, a1: option remember: if L = [] then RETURN([]): fi: if nops(L) = 1 then RETURN([seq(1, i = 1 .. L[1])]): fi: for i to nops(L) while 1 < L[i] do: od: r := i - 1: m := nops(L) - r: if L[1] mod 2 = 1 then a1 := 1/2*L[1] - 1/2: else a1 := 1/2*L[1]: fi: L1 := [seq(L[i] - 2, i = 2 .. r)]: M1 := InvSyl(L1): [a1 + r + m, a1 + r - 1, op(M1)]: end: # Having difficulties with this procedure.