To find the nth decagonal number, you can use the following formula:
decagonal_number = n * (3n - 1) / 2 * 10
where n
is the index of the decagonal number.
Here's the Typescript function that implements this formula:
index.ts91 chars4 lines
To use this function, simply call it with the index of the decagonal number you want to find:
index.ts68 chars2 lines
gistlibby LogSnag