% Programming and Numerical Methods
% MSc in Computational and Applied Physics

% Program 82 from Quarteroni, Sacco and Saleri 2007 
% alpha and beta coefficients of Legendre polynomials
% Algorithm 726: ORTHPOL
% Gautschi, W., ACM Trans. Math. Soft., 20(1), 21-62, 1994

function [a,b] = coeflege(n)
a = zeros(n,1) ; b = a ; b(1) = 2 ;
k = [2:n] ; b(k) = 1./(4-1./(k-1).^2) ;

