id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

pyramidal

The triangular numbers are 1,3,6,10,15,21,... where the nth number is n more than the preceding number. Given a positive integer n, compute the sum of the first n triangular numbers. (These are called pyramidal numbers.)

pyramidal(2) → 4
pyramidal(3) → 10
pyramidal(4) → 20

...Save, Compile, Run         

See Also: Example Code Java help: If Boolean Logic | Strings | While and For Loops | Arrays and Loops

Forget It! -- delete my code for this problem 220

Copyright Nick Parlante 2006-09 - privacy