GeeksforGeeks App
Open App
Browser
Continue

# Icosikaienneagonal Number

An icosikaienneagonal number is a class of figurate numbers. It has 29 – sided polygon called icosikaienneagon. The N-th icosikaienneagonal number count’s the 29 number of dots and all other dots are surrounding with a common sharing corner and make a pattern.
The first few icosikaienneagonol numbers are

1, 29, 84, 166 …

### Find the Nth icosikaienneagonal number

Given a number N, the task is to find Nth icosikaienneagonal number.
Examples:

Input: N = 2
Output: 29
Explanation:
The second icosikaienneagonol number is 29.
Input: N = 3
Output: 84

Approach:

• In mathematics, the N-th s-sided polygon number is given by the formula:

• Therefore Nth term of 29 sided polygon is

•

Below is the implementation of the above approach:

## C++

 // C++ implementation for// above approach #include using namespace std; // Function to Find the Nth// icosikaienneagonal Numberint icosikaienneagonalNum(int n){    return (27 * n * n - 25 * n) / 2;} // Driver Codeint main(){    int n = 3;    cout << icosikaienneagonalNum(n);     return 0;}

## Java

 // Java implementation for// above approachclass GFG{ // Function to Find the Nth// icosikaienneagonal Numberstatic int icosikaienneagonalNum(int n){    return (27 * n * n - 25 * n) / 2;} // Driver Codepublic static void main(String args[]){    int n = 3;    System.out.print(icosikaienneagonalNum(n));}} // This code is contributed by Code_Mech

## Python 3

 # Python3 implementation for# above approach # Function to Find the Nth# icosikaienneagonal Numberdef icosikaienneagonalNum(n):    return (27 * n * n - 25 * n) // 2 # Driver Code # Given NN = 3print(icosikaienneagonalNum(N)) # This code is contributed by Vishal Maurya

## C#

 // C# implementation for// above approachusing System;class GFG{ // Function to Find the Nth// icosikaienneagonal Numberstatic int icosikaienneagonalNum(int n){    return (27 * n * n - 25 * n) / 2;} // Driver Codepublic static void Main(){    int n = 3;    Console.Write(icosikaienneagonalNum(n));}} // This code is contributed by Code_Mech

## Javascript

 

Output:

84

Time Complexity: O(1)

Auxiliary Space: O(1)

My Personal Notes arrow_drop_up