LGIC - LOGIC

no tags 

Given a sequance of natural numbers.

Find N'th term of this sequence.

a1=2, a2=4, a3=11, a4=36, a5=147, a6=778 ... ... ... ... aN.

Input

 

Only one natural number 7<=N<20.

Output

One natural number. N'th term of the sequence.

Example

Input:
10
Output:
3629814

hide comments
MR. BEAN : 2015-01-21 02:20:45

My first python code :)

(Tjandra Satria Gunawan)(曾毅昆): 2015-01-21 02:20:45

@numerix: thanks, now 58B with built in function ;)

numerix: 2015-01-21 02:20:45

@Tjandra: You can solve it with less than 60 bytes ...

(Tjandra Satria Gunawan)(曾毅昆): 2015-01-21 02:20:45

only 79 characters needed to code the solution in python 3 (79B) ;)

:D: 2015-01-21 02:20:45

I would say O(N) will most certainly pass.

numerix: 2015-01-21 02:20:45

Please open it for more/all languages.
Edit: It's done, thanks.

Last edit: 2012-02-21 09:36:07
[Rampage] Blue.Mary: 2015-01-21 02:20:45

O(N) solution CAN pass.


Added by:Azat Taryhchiyev
Date:2012-02-15
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:KG Regional Contest