An integer N is a triangular number iff 1+8N is a perfect square. E.g. 10 is triangular, because 1+8*10=81 is a square; 12 is not, because 1+8*12=97 is not a square.

Details why this is so are left as an easy exercise for the interested reader.