data/problems/45.yml
---
:id: 45
:name: Triangular, pentagonal, and hexagonal
:url: https://projecteuler.net/problem=45
:content: |+
Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
| Triangle | | T<sub><i>n</i></sub>=_n_(_n_+1)/2 | | 1, 3, 6, 10, 15, ... |
| Pentagonal | | P<sub><i>n</i></sub>=_n_(3_n_−1)/2 | | 1, 5, 12, 22, 35, ... |
| Hexagonal | | H<sub><i>n</i></sub>=_n_(2_n_−1) | | 1, 6, 15, 28, 45, ... |
It can be verified that T<sub>285</sub> = P<sub>165</sub> = H<sub>143</sub> = 40755.
Find the next triangle number that is also pentagonal and hexagonal.