Question: Python! Please! Problem 1 - Pentagonal Procession Complete the following program that reads in a positive integer k and prints out the first k pentagonal
Python! Please!
Problem 1 - Pentagonal Procession Complete the following program that reads in a positive integer k and prints out the first k pentagonal numbers starting from 1. The nth pentagonal number is defined by 3n-n 2 Each pentagonal number should be a whole number, and there should be a single space separating successive pentagonal numbers. Input Format For Custom Testing The only line of input contains an integer that is greater than or equal to 1. Sample Case 1 Sample Input For Custom Testing 3 Sample Output 1 5 12 Sample Case 2 Sample Input For Custom Testing 1 Sample Output 1 Sample Case 3 Sample Input For Custom Testing 10 Sample Output 15 12 22 35 51 70 92 117 145
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
