In BSMathTests testTriangleNumberAlmostTooBig empirically determine maximum input value is 131071.