Explanation on how to check for a pentagonal number and implementation.