Exemple #1
0
def solve():
    # all hexagonal numbers are also triangle
    return next(n for n in set(pentagonal(100000)) & set(hexagonal(100000))
                if n > 40755)
Exemple #2
0
def solve():
    l = list(pentagonal(10000))
    s = set(l)
    return next(m - n for n in l for m in l
                if m - n in s
                if m + n in s)
Exemple #3
0
def solve():
    l = list(pentagonal(10000))
    s = set(l)
    return next(m - n for n in l for m in l if m - n in s if m + n in s)