A program in Java to display the first 50 pentagonal numbers.
In the above Java program to display the first 50 pentagonal numbers, we first need to understand what is pentagon? A pentagonal number is a figurative number that extends the concept of triangular and square numbers to the pentagon, but, unlike the first two, the patterns involved in the construction of pentagonal numbers are not…