Answer:
from math import sqrt
def getPentagonalNumber(n):
return int((3 * n * n - n) / 2)
for p in range(1, 100, 10):
for x in range(p, p+10):
print(getPentagonalNumber(x), end=" ")
print()
Step-by-step explanation:
The nth pentagonal number can be found by
![(3n^(2) -n )/(2)](https://img.qammunity.org/2021/formulas/computers-and-technology/college/1wd3k12yfbloaz3yvohzaod3whdqdu85kz.png)
Create a function called getPentagonalNumber that takes one parameter, n and calculates the nth pentagon number using the formula
Create a nested for loop that iterates 100 times. Call the getPentagonalNumber function inside the loop to calculate the first 100 pentagonal number with 10 numbers on each line