from math import floor, sqrt


def is_triangular(num):
    """
    Determine if a number is of the form (1/2)n(n+1).
    """

    assert isinstance(num, int) and num > 0
    near_sqrt = floor(sqrt(2 * num))
    return bool(int((1 / 2) * near_sqrt * (near_sqrt + 1)) == num)