Question: Making unspecified items of a list return 0.

Hi there!

I am trying to save the coefficients of a polynomial in a list to work with them in a rather complicated procedure. It is about representing a polynomial via a set of orthogonal polynomials phi_n which change depending on the input. For example, phi_s*phi_0=1*phi_s, so the coefficient of phi_s is 1 and the rest is 0. I save this as a[s][0][s]:=1. In this procedure, however, the coefficient of phi_{s+1} or phi_{s+10} might come up, and I have not declared them as 0, so the procedure stops whenever something like a[s][0][s+2] or a[s][0][s+10] appears. I could work with polynomials I guess, saving x^s for the result of

phi_s*phi_0 and working with coeff (x^s,n), which would indeed return 0 if n is not s instead of aborting the entire procedure, however, to me, it's not quite beautiful coding to encrypt the needed coefficients in another polynomial instead of just extracting them into a list. Is there a way to tell Maple that anything unspecified, a[s][j][x], shall just be 0?
 
Thank you in advance, Daniel
 
 
Please Wait...