# triangular number counting function

For a given nonnegative number $x$, the triangular number counting function counts how many triangular numbers are not greater than $x$. The formula is simple:

 $\lfloor\frac{-1+\sqrt{8x+1}}{2}\rfloor,$

in sharp contrast to the lack of a formula for the prime counting function $\pi(x)$. If one accepts 0 as a triangular number, the formula easily accommodates this by the mere addition of 1 after flooring the fraction.

## References

• 1 Zhi-Wei Sun, “On Sums of Primes and Triangular Numbers” ArXiv preprint, 10 April (2008): 1
Title triangular number counting function TriangularNumberCountingFunction 2013-03-22 18:03:03 2013-03-22 18:03:03 PrimeFan (13766) PrimeFan (13766) 5 PrimeFan (13766) Definition msc 11A25