yaworsw/euler-manager

View on GitHub
data/problems/45.yml

Summary

Maintainability
Test Coverage
---
: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 | &nbsp; | T<sub><i>n</i></sub>=_n_(_n_+1)/2 | &nbsp; | 1, 3, 6, 10, 15, ... |
  | Pentagonal | &nbsp; | P<sub><i>n</i></sub>=_n_(3_n_−1)/2 | &nbsp; | 1, 5, 12, 22, 35, ... |
  | Hexagonal | &nbsp; | H<sub><i>n</i></sub>=_n_(2_n_−1) | &nbsp; | 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.