Open In App

4294967295-gon Number

Last Updated : 24 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

4294967295-gon Number is a class of figurate numbers. It has a 4294967295 sided polygon called 4294967295-gon. The N-th 4294967295-gon number counts the 4294967295 number of dots and all other dots are surrounding with a common sharing corner and make a pattern.
The first few 4294967295-gonol numbers are: 
 

1, 4294967295, 12884901882,… 
 


 

Check if N is a 4294967295-gon Number


Given a number N, the task is to find Nth 4294967295-gon number
Examples: 
 

Input: N = 2 
Output: 4294967295 
Explanation: 
The second 4294967295-gonol number is 4294967295. 
Input: N = 3 
Output: 12884901882 
 


 


Approach: The N-th 4294967295-gon number is given by the formula: 
 

  • N-th term of S sided polygon = \frac{((S - 2)N^{2} - (S - 4)N)}{2}
     
  • Therefore N-th term of 4294967295 sided polygon is given by: 
     

Tn =\frac{((4294967295 - 2)N^{2} - (4294967295 - 4)N)}{2} =\frac{(4294967293N^{2} - 4294967291N)}{2}
 


  •  


Below is the implementation of the above approach: 
 

C++

// C++ program to find N-th
// TetracontapentagonNum number
#include<bits/stdc++.h>
using namespace std;
 
// Function to find the nth
// 4294967295-gon number
static long gonNum4294967295(int N)
{
    return (4294967293L * N *
        N - 4294967291L * N) / 2;
}
 
// Driver code
int main()
{
    int n = 3;
    cout << "3rd 4294967295-gon Number is "
         << gonNum4294967295(n);
}
 
// This code is contributed by Code_Mech

                    

Java

// Java program to find N-th
// TetracontapentagonNum number
class GFG{
 
// Function to find the nth
// 4294967295-gon number
static long gonNum4294967295(int N)
{
    return (4294967293L * N *
        N - 4294967291L * N) / 2;
}
 
// Driver code
public static void main(String[] args)
{
    int n = 3;
    System.out.print("3rd 4294967295-gon Number is " +
                                 gonNum4294967295(n));
}
}
 
// This code is contributed by Pratima Pandey

                    

Python3

# Python3 program to find the N-th
# 4294967295-gon number
 
# Function to find the N-th
# 4294967295-gon number
def gonNum4294967295(N):
 
    return (4294967293 * N * N - 4294967291 * N) // 2
 
# Driver Code
 
# Given Number
n = 3
 
# Function Call
print("3rd 4294967295-gon Number is ",
                gonNum4294967295(n))

                    

C#

// C# program to find N-th
// TetracontapentagonNum number
using System;
class GFG{
 
// Function to find the nth
// 4294967295-gon number
static long gonNum4294967295(int N)
{
    return (4294967293L * N *
        N - 4294967291L * N) / 2;
}
 
// Driver code
public static void Main()
{
    int n = 3;
    Console.Write("3rd 4294967295-gon Number is " +
                              gonNum4294967295(n));
}
}
 
// This code is contributed by Code_Mech

                    

Javascript

<script>
// Javascript program to find N-th
// TetracontapentagonNum number
 
    // Function to find the nth
    // 4294967295-gon number
    function gonNum4294967295(N)
    {
        return ((4294967293 * N * N ) - (4294967291 * N)) / 2;
    }
 
    // Driver code
      
    let n = 3;
    document.write("3rd 4294967295-gon Number is " + gonNum4294967295(n));
         
// This code is contributed by aashish1995
</script>

                    

Output: 
3rd 4294967295-gon Number is  12884901882

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads