Home  >  Article  >  Backend Development  >  C program to find decagon numbers?

C program to find decagon numbers?

WBOY
WBOYforward
2023-08-31 23:09:071380browse

Decagonal numbers are graphics derived using the concepts of triangular numbers and square numbers. Extensions of this number pattern are created using non-rotationally symmetric numbers. This number for nested decagons is given by the number of points in the number of nested decagons created.

For example, for the 3rd decagon number, 3 decagon numbers are nested in iX times the number of sides of the decagon. As shown in the picture-

C program to find decagon numbers?

The side of the first external figure = 30

The side of the second external figure = 20

Inner picture Edges in = 10

All shared edges = 6 2

Total = 30 20 10-(6 2) = 52

This result is generalized using the formula 4n2 - 3n .

This gives the decagonal number of n

The above is the detailed content of C program to find decagon numbers?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete