Search a number
octagonal n.  and  pentagonal n.

First numbers that belong to both sets: