HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50163 - Pentagonal Numbers

Section problems

• 50018 - Falling Distance
• 50020 - Population Bar Chart
• 50029 - Buying Carpets
• 50045 - Class GPA Average
• 50064 - Water Bills
• 50068 - Sum of kth Anti-diagonal
• 50095 - Call Center
• 50152 - Prime Factors of a Number
• 50163 - Pentagonal Numbers
• 50167 - Total invoice amount
• 50169 - Prime Factorization
• 50173 - Sum of prime numbers fro...
• Простые числа (2)
• 50026 - Variance of a series
• 50032 - 100 Factorial
• 50033 - The number of Ending Zero...

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. Difficulty Beta

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