1. The table below shows the formulas for triangular, pentagonal, and hexagonal numbers.
... | ... | ... |
---|---|---|
Triangular | Tn = n(n+1)/2 | 1, 3, 6, 10, 15, ... |
Pentagonal | Pn = n(3n-1)/2 | 1, 5, 12, 22, 35, ... |
Hexagonal | Hn = n(2n-1) | 1, 6, 15, 28, 45, ... |
The number T285 = P165 = H143 = 40755 is a triangular number, a pentagonal number, and a hexagonal number. Write code to find the next number like this.