#! /usr/bin/env python3 """ pe12.py https://mind.kittttttan.info/py/pe12 """ from pe import count_divisors # https://mind.kittttttan.info/py/pe0.html def pe12(sub=500): """ What is the value of the first triangle number to have over five hundred divisors? """ t = 1 i = 2 while 1: c = count_divisors(t) if c >= sub: break t += i i += 1 print(t) if __name__ == "__main__": pe12()