# OK to post homework # Hari Amoor, 10/14/2020, HW #9 with(combinat): # Problem 1 # (i) DiagSeq2(1/(1-1*x-9*y+1*x*y-2*x^3+1*y^3),x,y,50)[51] = 656121696907513857036622746341010698644640606651318753632076909371800565836900539 # (ii) DiagWalks3D({[1,2,2],[9,0,0],[0,2,2]},30)[31] = 433160 # Problem 2 WordsMod := proc(a,S,x) local i,w,y,z: z := 0: for i from 1 to a do if (i in S) then z := z + x^i: fi: od: w := 1 - x^a: y := z/w: RETURN(factor(normal(1/(1-y)))): end: # seq(coeff(taylor(WordsMod(5,{1,2,3,4},x),x=0,101),x,i),i=0..100)[101] = 118272656870560296827634782280 # Problem 3 ResComps := proc(S,x) local i,f,s: f := x/(1-x) - add(x^s, s in S): RETURN(factor(normal(1/(1-f)))): end: # seq(coeff(taylor(ResComps({2,3},x),x=0,301),x,i),i=0..300)[301] = 179789662603291780480882832586094549526183607154633616127794901 # Problem 4 # (i) The value is A00984 We approximate f(n) = (4n+2)/(n*f(n-1)) with f(0) = 1. # (ii) The value is A001850 in the OEIS. We approximate f(n) = f(n) = (6n-3)/(n*f(n-1)) + (1-n)/(n*f(n-2)) with f(0) = 1, f(1) = 3. # (iii) The value is A036692 in the OEIS. We approximate f(n) = {(352*n^3 + 2768*n^2 + 7088*n + 5920)*f(n + 1) + (-484*n^3 - 4048*n^2 - 11184*n - 10204)*f(n + 2) + (-352*n^3 - 3120*n^2 - 9114*n - 8766)*f(n + 3) + (55*n^3 + 515*n^2 + 1570*n + 1560)*f(n + 4) with f(0) = 1, f(1) = 2, f(2) = 14, f(3) = 84. # (iv) The value is A192365 in the OEIS. We cannot solve for an approximation in Maple. # Problem 5 # (i) The value is A006480 in the OEIS. We approximate f(n) = (27n^2 + 27n + 6)/(n^2 + 2n + 1) * f(n - 1) with f(0) = 1. # (ii) The value is A268542 in the OEIS. We approximate f(n) = {(-567*n^3 - 4104*n^2 - 9549*n - 7140)*f(n + 1) + (-1281*n^3 - 10553*n^2 - 28546*n - 25400)*f(n + 2) + (-672*n^3 - 6208*n^2 - 18752*n - 18400)*f(n + 3) + (42*n^3 + 430*n^2 + 1424*n + 1504)*f(n + 4) with f(0) = 1, f(1) = 4, f(2) = 42, f(3) = 520. # (iii) The value is A112019 in the OEIS. We approximate f(n) = (-59*n^3 - 448*n^2 - 1084*n - 848)*f(n + 1) + (-295*n^3 - 2535*n^2 - 7185*n - 6740)*f(n + 2) + (-2301*n^3 - 22074*n^2 - 69941*n - 73044)*f(n + 3) + (118*n^3 + 1250*n^2 + 4336*n + 4896)*f(n + 4) with f(0) = 1, f(1) = 5, f(2) = 55, f(3) = 749. # Problem 6 DiagSeq4:=proc(f,x1,x2,x3,x4,N) local i: if subs({x1=0,x2=0,x3=0,x4=0},denom(f))=0 then RETURN(FAIL): fi: [seq(coeff(taylor(coeff(taylor(coeff(taylor(coeff(taylor(f,x1=0,N+1),x1,i),x2=0,N+1),x2,i),x3=0,N+1),x3,i),x4=0,N+1),x4,i),i=0..N)]: end: DiagWalks4D:=proc(S,N) local s,x,y,z,w: if not (type(S, set) and type(N,integer) and N>=0) then RETURN(FAIL): fi: DiagSeq4(1/(1-add(x^s[1]*y^s[2]*z^s[3]*w^s[4], s in S)),x,y,z,w,N ): end: