A decagonal number is a figurate number that extends the concept of triangular and square numbers to the decagon (a ten-sided polygon). The n^{th} decagonal numbers counts the number of dots in a pattern of n nested decagons, all sharing a common corner, where the i^{th} decagon in the pattern has sides made of i dots spaced one unit apart from each other. The n-th decagonal number is given by the formula D(n)=4n^{2}-3n;

The first few decagonal numbers are:

0, 1, 10, 27, 52, 85, 126, 175, 232, 297, 370, 451, 540, 637, 742, 855, 976, 1105, 1242……

Input : n = 2 Output : 10 Input : n = 5 Output : 85 Input : n = 7 Output: 175

`// C program to find nth decagonal number ` `#include <stdio.h> ` `#include <stdlib.h> ` ` ` `// Finding the nth Decagonal Number ` `int` `decagonalNum(` `int` `n) ` `{ ` ` ` `return` `(4 * n * n - 3 * n); ` `} ` ` ` `// Driver program to test above function ` `int` `main() ` `{ ` ` ` `int` `n = 10; ` ` ` `printf` `(` `"Decagonal Number is = %d"` `, ` ` ` `decagonalNum(n)); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

**Output:**

Decagonal Number is = 370

**References :** Mathworld

This article is contributed by **DANISH_RAZA**. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Program to check if N is a Centered Decagonal Number
- Program to check if N is a Decagonal Number
- Find the sum of the first N Centered Decagonal Numbers
- Centered decagonal number
- Decagonal Numbers
- Second decagonal numbers
- Program to find last digit of n'th Fibonnaci Number
- Program to find Cullen Number
- Program to find Star number
- Puzzle | Program to find number of squares in a chessboard
- Program to find remainder when large number is divided by 11
- Program to find last two digits of Nth Fibonacci number
- Program to find the number of region in Planar Graph
- Program to find number of solutions in Quadratic Equation
- Program to find the nth Kynea number
- Program to find total number of edges in a Complete Graph
- Program to find the Hidden Number
- Program to find the Nth Harmonic Number
- Program to find remainder when large number is divided by r
- Program to find minimum number of lectures to attend to maintain 75%