def sigma_pentagonal_numbers(limit):
    '\n    >>> list(sigma_pentagonal_numbers(16))\n    [1, 2, 5, 7, 12, 15]\n    '
    n = 1
    p = 1
    while (p <= limit):
        (yield p)
        if (n > 0):
            n = (- n)
        else:
            n = ((- n) + 1)
        p = ((((3 * n) * n) - n) // 2)
>>> list(sigma_pentagonal_numbers(16))
[1, 2, 5, 7, 12, 15]
def sigma_pentagonal_numbers(limit):
    '\n    >>> list(sigma_pentagonal_numbers(16))\n    [1, 2, 5, 7, 12, 15]\n    '
    n = 1
    p = 1
    while (p <= limit):
        (yield p)
        if (n > 0):
            n = (- n)
        else:
            n = ((- n) + 1)
        p = ((((3 * n) * n) - n) // 2)