      SUBROUTINE LEGPOL (XX,Y,N)
      IMPLICIT  REAL*8   (A-H,O-Z)
C *** SEE R H LANDAU, PROGRAM LPOTT, 1981
      DIMENSION Y(50)
      Y(1) = 1.
      Y(2) = XX
      IF (N.GT.2) GO TO 10
      RETURN
 10   DO 20 I=2,N
         G = XX*Y(I)
         Y(I+1) = G-Y(I-1)+G-(G-Y(I-1))/I
 20   CONTINUE
      RETURN
      END
