Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Pentagonal Numbers Name: Exercise 11 1.java A pentagonal number is a number that fulfils the following formula for some positive integer n: p(n) =
1. Pentagonal Numbers Name: Exercise 11 1.java A pentagonal number is a number that fulfils the following formula for some positive integer n: p(n) = n (3n-1 ) Write a program that gets a number from the user and displays the first that many pentagonal numbers. Here's the header for the method to get you started: public static int pentagonalfint n) Sample Runs: Enter number: 10 p(1) 1 P (2) 5 P(3)12 P(4) 22 (5) = 35 p(7) = 70 p(8) = 92 P (9) 117 P (10) 145 Enter number: 5 P(3) 12 p (4) 22 PIS) 35
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started