pronic number a number n is said to be a proic number if there exists an integer m such that n m m 1 examples of proic numbers 0 2 6 12 20 30 42 56 72 90 110 https en wikipedia orgwikipronicnumber akshay dubey https github comitsakshaydubey doctest normalizewhitespace this functions takes an integer number as input returns true if the number is pronic ispronic1 false ispronic0 true ispronic2 true ispronic5 false ispronic6 true ispronic8 false ispronic30 true ispronic32 false ispronic2147441940 true ispronic9223372033963249500 true ispronic6 0 traceback most recent call last typeerror input value of number6 0 must be an integer akshay dubey https github com itsakshaydubey doctest normalize_whitespace this functions takes an integer number as input returns true if the number is pronic is_pronic 1 false is_pronic 0 true is_pronic 2 true is_pronic 5 false is_pronic 6 true is_pronic 8 false is_pronic 30 true is_pronic 32 false is_pronic 2147441940 true is_pronic 9223372033963249500 true is_pronic 6 0 traceback most recent call last typeerror input value of number 6 0 must be an integer
def is_pronic(number: int) -> bool:
    
    if not isinstance(number, int):
        msg = f"Input value of [number={number}] must be an integer"
        raise TypeError(msg)
    if number < 0 or number % 2 == 1:
        return False
    number_sqrt = int(number**0.5)
    return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
    import doctest

    doctest.testmod()