Polygonal numbers and Rogers–Ramanujan–Gordon theorem