{"id":25734,"date":"2021-12-04T09:20:05","date_gmt":"2021-12-04T03:50:05","guid":{"rendered":"https:\/\/python-programs.com\/?p=25734"},"modified":"2021-12-04T09:20:05","modified_gmt":"2021-12-04T03:50:05","slug":"python-program-to-find-nth-decagonal-number","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-nth-decagonal-number\/","title":{"rendered":"Python Program to Find nth Decagonal Number"},"content":{"rendered":"

Decagonal Number:<\/strong><\/p>\n

A decagonal number is a figurate number that extends the triangle and square number concepts to the decagon (a ten-sided polygon). \u00a0The nth decagonal number counts the number of dots in a pattern of n nested decagons, each of which has a shared corner.<\/p>\n

Formula to generate a Decagonal Number:<\/strong><\/p>\n

D(n) = 4*n^2 - 3*n<\/pre>\n

Given a number and the task is to find the decagonal number of a given number.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Number = 4<\/pre>\n

Output:<\/strong><\/p>\n

The decagonal number of a given number { 4 } = \r\n52<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Number = 10<\/pre>\n

Output:<\/strong><\/p>\n

The decagonal number of a given number { 10 } = \r\n370<\/pre>\n

Program to Find nth Decagonal Number in Python<\/h2>\n