Question: Part 2 A pentagonal number is one that corresponds to dots arranged into a pentagon. Here are the first four pentagonal numbers and their pentagons:

 Part 2 A pentagonal number is one that corresponds to dots

Part 2 A pentagonal number is one that corresponds to dots arranged into a pentagon. Here are the first four pentagonal numbers and their pentagons: The pentagonal number PN has sides made of N dots. When you count the dots for a pentagonal number include the dots for the inner pentagons. So to figure out how many dots PN has, find out how many does P(N-1) has and add the dots for the new sides of size N. P1 - 1, P2 - 5, P3 - 12, P4 - 22 Figure out a recursive formula for PN and then write a program that implements it (10 marks). Make a complete program similar to TriangleTester.java given in the chapter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!