HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50579 - Pentagonal Numbers

Guest
• Review clarifications (4)

Section problems

• 50557 - nth Power of m (Long Multiply)
• 50559 - Prime Factors of a Number
• 50565 - Binary numbers
• 50568 - Body Mass Index Calculator
• 50571 - Armstrong Numbers - 2
• 50572 - Palindromic Numbers
• 50574 - Triangular Numbers
• 50578 - Mersenne prime
• 50579 - Pentagonal Numbers
• 50581 - The roots of a quadratic eq...
• 50582 - Number of digits
• 50583 - Max of 3 numbers
• 50584 - Total invoice amount
• 50585 - Inner Product
• 50587 - Modular Conversion
• 50595 - Sum of the numbers
• 50599 - Sum of Squared Error (SSE...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 4000/7000/7000/7000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Arban Uka.

nth Pentagonal Number

Shqip

In mathematics, pentagonal numbers is calculated with the following formula:
    
Thus, the first 10 pentagonal numbers: 1, 5, 12, 22, 35, 51, 70, 92, 117, 145.

Write a program that is going to calculate and show nth pentagonal number.

Input specification
There will be just one number (n) where 1 ≤ n ≤ 35000.

Output specification
Show nth pentagonal number.


  Sample Input I:
   5

  Sample Input II:
   34004

  Sample Output I:
   35

  Sample Output II:
   1734391022


Для отправки решений необходимо выполнить вход.

www.contester.ru