Skip to content

Instantly share code, notes, and snippets.

View mark665's full-sized avatar

Mark Price mark665

View GitHub Profile
@mark665
mark665 / fullbeaker.md
Created March 22, 2017 22:36
Full Beaker "Homework"

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.