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
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