きったんの頭

#! /usr/bin/env python3
"""
pe23.py
https://mind.kittttttan.info/py/pe23
"""

# https://mind.kittttttan.info/py/pe0
from pe import spd

def pe23(limit=28123):
    """
    Find the sum of all the positive integers
    which cannot be written as the sum of two abundant numbers.
    """
    s = 0
    abn = set()
    for n in range(1, limit):
        if spd(n) > n:
            abn.add(n)
        if not any((n - a in abn) for a in abn):
            s += n
    print(s)

if __name__ == "__main__":
    pe23()