Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

How is IMC involved in creating social meaning for a brand?

Answered: 1 week ago