id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

simona1@sfusd.edu recursiontwo > pentagonalNumber
prev  |  next  |  chance

The first Pentagonal Number is 1. The second is 5. Each subsequent pentagonal number is 2 times the previous pentagonal number + 3 - the pentagonal number that is 2 positions earlier in the sequence. The first 10 pentagonal numbers are 1, 5, 12, 22, 35, 51, 70, 92, 117, and 145.


pentagonalNumber(0) → 1
pentagonalNumber(1) → 5
pentagonalNumber(2) → 12

...Save, Compile, Run (ctrl-enter)

public int pentagonalNumber(int n){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy