#hw9.txt. February 23, 2014. Katie McKeon read(`C9.txt`): Help9:=proc() print(`ApplyUmbra(P,x,U,m) PnG(n,x,U,m) GuessCoeff(n,i,U,m)`): end: #Inputs a polynomial P(x) and a discrete expression U(m) and #replaces x^m by U(m) in the polynomial ApplyUmbra:=proc(P,x,U,m) local deg, i: add(coeff(P, x, i)*subs(m=i,U), i=0..degree(P,x)): end: #PnG(n,x,U,m) inputs a degree n, variable x, and discrete umbra #expression U(m) and returns the unique monic polynomial P(x) of #degree n such that the umbra expression applied to P*x^i gives #0 for all i=0,...,n-1 PnG:=proc(n,x,U,m) local P, var, eq: P:=x^n+add(a[i]*x^i,i=0..n-1): var:={seq(a[i],i=0..n-1)}: eq:={ seq( ApplyUmbra(P*x^i,x,U,m), i=0..n-1)}: sort(subs(solve(eq,var),P)): end: #GuessCoeff(n,i,U,m) inputs a discrete variable n, non-negative integer i, and an #umbra expression U(m) and tries to find a rational function R(n) so that #R(n) gives the coefficient of x^(n-i) in PnG(n,x,U,m) GuessCoeff:=proc(n,i,U,m) local L, j: L:=[seq(coeff(PnG(j,x,U,m),x^(j-i)), j=i+1..10)]: GuessRF(L,n): end: #Rational functions from GuessCeoff for the coefficient of x^(n-i) in PnG(n,x,U,m) #U(m)=1/(m+1) #i=0 -> R(n)=1 #i=1 -> R(n)=-n/2-1/2 #i=2 -> R(n)=(n^3+2+5n+4n^2)/(12+8n) #i=3 -> R(n)=(n^4+6+17n+17n^2+7n^3)/(-120-48n) #i=4 -> R(n)=(n^6+48+172n+244n^2+175n^3+67n^4+13n^5)/(3360+2304n+384n^2) #i=5 -> R(n)=(n^7+240+908*n+1392*n^2+1119*n^3+510*n^4+132*n^5+18*n^6)/ # (-60480-30720*n-3840*n^2) #i=6 -> R(n)=(n^9+4320+18504*n+33468*n^2+33578*n^3+20643*n^4+8085*n^5+2022*n^6+312*n^7+27*n^8)/ # (3991680+2753280*n+622080*n^2+46080*n^3) #i=7 -> R(n)=(n^10+30240+133848*n+252780*n^2+268514*n^3+178079*n^4+77238*n^5+22239*n^6+4206*n^7+501*n^8+34*n^9)/ # (-103783680-57899520*n-10644480*n^2-645120*n^3) #U(m)=1/(m+3) #i=0 -> R(n)=1 #i=1 -> R(n)=(n^2+3+4*n)/(-4-2*n) #i=2 -> R(n)=(n^3+8+14*n+7*n^2)/(20+8*n) #i=3 -> R(n)=(n^4+30+61*n+41*n^2+11*n^3)/(-168-48*n) #i=4 -> R(n)=(n^6+432+1116*n+1104*n^2+545*n^3+143*n^4+19*n^5)/(6048+3072*n+384*n^2) #i=5 -> R(n)=(n^7+2520+6954*n+7585*n^2+4309*n^3+1390*n^4+256*n^5+25*n^6)/(-95040-38400*n-3840*n^2) #i=6 -> R(n)=(n^9+69120+218304*n+286656*n^2+208172*n^3+92904*n^4+26565*n^5+4884*n^6+558*n^7+36*n^8)/ # (7413120+4135680*n+760320*n^2+46080*n^3) #i=7 -> R(n)=(n^10+544320+1789344*n+2478996*n^2+1930080*n^3+942535*n^4+303212*n^5+65303*n^6+9320*n^7+845*n^8+44*n^9)/ # (-172972800-81123840*n-12579840*n^2-645120*n^3) #U(m)=eval(m!) #i=0 -> R(n)=1 #i=1 -> R(n)= - computation had to be interrupted for i>0 #i=2 -> R(n)= #i=3 -> R(n)= #i=4 -> R(n)= #i=5 -> R(n)= #i=6 -> R(n)= #i=7 -> R(n)=