%-------------------------------------------------------------------------------------- % C-matrices for partial sums of extended geometric series %-------------------------------------------------------------------------------------- % This program was written in April 2006 by Stan Sykora while writing % the article on 'Finite and Infinite Sums of the Power Series (k^p)(x^k)', % published online at www.ebyte.it/library/docs/math06b/PowerSeriesKpXk.html. % The program is an attachment to the said article. %-------------------------------------------------------------------------------------- % The AUTHOR hereby authorizes EVERYBODY to copy, distribute, cut, or modify % the program in whichever form and by whatever means. If you use it and obtain % interesting results, however, you should cite the Web article. % You can use its DOI link: http://dx.doi.org/10.3247/SL1Math06.002 % % The AUTOR DISCLAIMS any LIABILITIES which any misguided soul might claim, % due to whatever he/she has done with the program or just thinks to have done. clear;clc;echo off; for p=1:17 % Don't go beyond! It overflows C(1:p+2,1:p+2) = 0; C(2:3,2:3) = [1,1;0,-1]; for pp=1:p-1; CC(1:p+2,1:p+2) = 0; for m=0:pp+1; for nu=0:pp+1; CC(m+2,nu+2) = (1+m)*C(m+2,nu+2)+(pp+1-m)*C(m+1,nu+2)+C(m+2,nu+1)-C(m+1,nu+1); end; end; C = CC; end; p C(2:p+2,2:p+2) end