Students should be shown how to derive the formula pentagonal and hexagonal numbers, as seen here. Then they should learn how to derive the general formula, that of the polygonal numbers, as seen here.