The following numbers form the concentric hexagonal sequence :

*0, 1, 6, 13, 24, 37, 54, 73, 96, 121, 150 ……*

The number sequence forms a pattern with concentric hexagons, and the numbers denote the number of points required after the n-th stage of the pattern.

**Examples:**

Input :N = 3

Output :13

Input :N = 4

Output :24

**Approach :**

The above series can be referred from Concentric Hexagonal Numbers.

**N**th term of the series is **3*n ^{2}/2 **

Below is the implementation of the above approach :

## C++

`// CPP program to find nth concentric hexagon number ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to find nth concentric hexagon number ` `int` `concentric_Hexagon(` `int` `n) ` `{ ` ` ` `return` `3 * ` `pow` `(n, 2) / 2; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `int` `n = 3; ` ` ` ` ` `// Function call ` ` ` `cout << concentric_Hexagon(n); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java program to find ` `// nth concentric hexagon number ` `class` `GFG ` `{ ` ` ` ` ` `// Function to find ` ` ` `// nth concentric hexagon number ` ` ` `static` `int` `concentric_Haxagon(` `int` `n) ` ` ` `{ ` ` ` `return` `3` `* (` `int` `)Math.pow(n, ` `2` `) / ` `2` `; ` ` ` `} ` ` ` ` ` `// Driver Code ` ` ` `public` `static` `void` `main (String[] args) ` ` ` `{ ` ` ` `int` `n = ` `3` `; ` ` ` ` ` `// Function call ` ` ` `System.out.println(concentric_Haxagon(n)); ` ` ` `} ` `} ` ` ` `// This code is contributed by ` `// sanjeev2552 ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 program to find ` `# nth concentric hexagon number ` ` ` `# Function to find ` `# nth concentric hexagon number ` `def` `concentric_Hexagon(n): ` ` ` ` ` `return` `3` `*` `pow` `(n, ` `2` `) ` `/` `/` `2` ` ` `# Driver code ` `n ` `=` `3` ` ` `# Function call ` `print` `(concentric_Hexagon(n)) ` ` ` `# This code is contributed by Mohit Kumar ` |

*chevron_right*

*filter_none*

## C#

`// C# program to find nth concentric hexagon number ` `using` `System; ` `class` `GFG ` `{ ` ` ` `// Function to find nth concentric hexagon number ` `static` `int` `concentric_Hexagon(` `int` `n) ` `{ ` ` ` `return` `3 * (` `int` `)Math.Pow(n, 2) / 2; ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main() ` `{ ` ` ` `int` `n = 3; ` ` ` ` ` `// Function call ` ` ` `Console.WriteLine(concentric_Hexagon(n)); ` `} ` `} ` ` ` `// This code is contributed by Nidhi ` |

*chevron_right*

*filter_none*

**Output:**

13

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 Concentric Hexagonal Number
- Find all numbers up to N which are both Pentagonal and Hexagonal
- Second hexagonal numbers
- Check if a given circle lies completely inside the ring formed by two concentric circles
- Program to calculate the area between two Concentric Circles
- Hexagonal Number
- Centered hexagonal number
- Surface Area and Volume of Hexagonal Prism
- Program to check if N is a Centered Hexagonal Number
- Program to check if N is a Hexagonal Number or not
- Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
- Count numbers which can be constructed using two numbers
- Maximum sum of distinct numbers such that LCM of these numbers is N
- Numbers less than N which are product of exactly two distinct prime numbers
- Print N lines of 4 numbers such that every pair among 4 numbers has a GCD K
- Absolute Difference between the Sum of Non-Prime numbers and Prime numbers of an Array
- Absolute difference between the Product of Non-Prime numbers and Prime numbers of an Array
- Count numbers which are divisible by all the numbers from 2 to 10
- Fill the missing numbers in the array of N natural numbers such that arr[i] not equal to i
- Check if a given pair of Numbers are Betrothed numbers or not

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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.