Hint

Answer

Multiply the number by 8 then add 1. If the result is a perfect square, then the original number is a triangle number.
For example: 10*8+1 = 81. 81 = 9^2. So 10 is a triangle number.
11*8+1 = 89. 89 is not a perfect square, so 11 is not a triangle number.Hide

Comments

Cool teaser! Here is another way. Double it. find the square root (approx) and round up and down to consecutive integers. If they give the double, it is triangular. Example 15 doubled is 30. Since it lies between 25 and 36 is square root is about 5.5. Rounding up and down make 5 and 6. 5x6 = 30 Yes!

is there any particular mathematical reasont hat works out, or is it just a rnadom quirk of mathematics that applies?
(also, once into bigger numbers, that method wont be so quick, trying to figure out perfect square and what not, but this is interestingly related to partial sum formula, because thats what triangle numbers are, sum of all integers from 1 to X. so for any number x, Sum = (x/2)*(2+(x-1)) for example, x=10, sum = 5*(2+9) = 55, t'works. dont bother trying to figure out the summation formula, I am telling you it works