def is_all_faster(min_t=0): for n in itertools.count(1): t = n * (2 * n - 1) if is_pentagonal(t) and t > min_t: yield t
def is_all(min_t=0): for n in itertools.count(1): t = n * (n + 1) / 2 if is_pentagonal(t) and is_hexagonal(t) and t > min_t: yield t