In this article, we will discuss about Hexahectagon number. According to definition of Hexahectagon number:
A Hexahectagon number is class of figurate number. It has 600 – sided polygon called Hexahectagon. The N-th Hexahectagon number count’s the 600 number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The first few Hexahectagonol numbers are 1, 600, 1797, 3592, 5985 …
Examples:
Input: N = 2
Output: 600
Explanation:
The second Hexahectagonol number is 600.
Input: N = 3
Output: 1797
Approach: The N-th Hexahectagon number is given by the formula:
Nth term of s sided polygon =

Therefore Nth term of 600 sided polygon is =

Below is the simply implementation of the above approach in Python –
# Python3 program to find the N-th
# Hexahectagon number
# Function to find the N-th
# Hexahectagon number
def HexahectagonNum(N):
return (598 * N * N - 596 * N) // 2
# Driver code
n = 3
print(HexahectagonNum(n))
Output:
1797
The time complexity of this program is O(1) because of no loops and no recursion. We have only formula calculation which is constant.
