def generate_pents(limit):
    """Generates pentagonal numbers up to limit"""
    n = 1
    pents = []
    while n*(3*n - 1)/2 < limit:
        pents.append((n*(3*n - 1)//2))
        n += 1
    return pents