def _laguerre_gen(x, alpha, nmax):
    
    """ Calculate generalized Laguerre polynomials
    of order `alpha` up to degree `nmax` with generic algebra,
    
    .. math:
       L^{(\\alpha)}_n(x)
      
    
    
    Parameters
    ----------
    x : ndarray, adarray, or other algebraic object
        The argument of the Laguerre polynomials
    alpha : float
        The order parameter.
    nmax : int
        The maximum degree.
        
    Returns
    -------
    L : list
        The generalized Laguerre polynomials as the 
        same type of `x`.
    
    """
    L = []
    
    if nmax >= 0:
        L0 = 1.0 + 0.0 * x # L_0 = 1, always
        L.append(L0)
    
    if nmax >= 1:
        L1 = 1.0 + alpha - x # L_1 = 1 + alpha - x, always
        L.append(L1)
        
    for n in range(2,nmax+1):
        #
        # Use recurrence relation
        #
        # L^a_n = (2n-1+a-x)L^a_{n-1} - (n-1+a)L^a_{n-2}
        #         -------------------------------------
        #                            n
        #
        
        f1 = (2*n - 1 + alpha - x) * L[-1]
        f2 = (n - 1 + alpha) * L[-2] 
        L.append((f1-f2) / n)
        
    return L