📜  4294967295-gon编号

📅  最后修改于: 2021-05-06 22:23:44             🧑  作者: Mango

4294967295-gon Number是一类数字。它具有一个4294967295边的多边形,称为4294967295-gon 。第N个4294967295角数计算4294967295点的数量,所有其他点都被一个公共的共享角包围并形成图案。
前几个4294967295-gonol号为:

检查N是否是4294967295-gon数

给定数字N ,任务是找到N4294967295-gon数
例子:

方法:N个4294967295号多边形由以下公式给出:

  • S面多边形的第N个项= \frac{((S - 2)N^{2} - (S - 4)N)}{2}
  • 因此,第4294967295个面多边形的第N个项由下式给出:

下面是上述方法的实现:

C++
// C++ program to find N-th
// TetracontapentagonNum number
#include
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


输出:
3rd 4294967295-gon Number is  12884901882