function G=p9G(alpha,nmax)
% Meijer's G function, the special case required for Problem #9.
if nargin<2, nmax=6; end
n=1:nmax; z=alpha^2/16; zn=cumprod([1,-z*ones(1,nmax)]);
s=cumprod([1,(alpha-2*n).*(alpha-2*n+1)./n./(n+1)./(2*n+1).^2]);
u=cumsum([1-log(alpha/2)-digamma(alpha+1)+2*digamma(1),...
  1./(alpha-2*n+1)+1./(alpha-2*n+2)+1./n+1./(2*n-1)+1./(2*n+1)]);
t=u.*cumprod([1,(alpha-2*n+1).*(alpha-2*n+2)./n.^2./(2*n-1)./(2*n+1)]);
G=2^alpha*alpha*(2*pi*z*sum(zn.*s)+sum(zn.*t));



