Triangular number is the amount of points that can fill equilateral triangle. 

Example: the number 6 is a triangular number because all sides of a triangle has the same amount of points.

```
Hint!
T(n) = n * (n + 1) / 2,
n - is the size of one side.
T(n) - is the triangular number.
```

Given a number 'T' from interval [1; 2147483646], find if it is triangular number or not.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code: def is_triangular(t):
	

Solutions:
def is_triangular(t):
	x = int((t * 2) ** 0.5)
	return t == x * (x + 1) / 2


def is_triangular(t):
	return (8 * t + 1) ** 0.5 % 1 == 0


def is_triangular(n):
	a = int((n * 2) ** 0.5)
	return n * 2 == a * (a + 1)


TRIANGULAR = {x * (x + 1) / 2 for x in range(10000)}
is_triangular = TRIANGULAR.__contains__


def is_triangular(n):
	return (-1 + (1 + 8 * n) ** 0.5) / 2 % 1 == 0


from math import sqrt

def is_triangular(t):
	n = (sqrt(8 * t + 1) - 1) / 2
	return False if n - int(n) > 0 else True


def is_triangular(t):
	return (-1 + (1 + 8 * t) ** 0.5) / 2.0 == int((-1 + (1 + 8 * t) ** 0.5) / 2.0)


def is_triangular(t):
	return not ((1 + 8 * t) ** 0.5 - 1) / 2 % 1