You are on page 1of 2

3: trigon

4: tetragon
5: pentagon
6: hexagon
7: heptagon
8: octagon
9: nonagon
10: decagon
11: undecagon
12: dodecagon
13: triskaidecagon
14: tetradecagon
15: pentadecagon
16: hexadecagon
17: heptadecagon
18: octadecagon
19: nonadecagon
20: icosagon
21: icosikaihenagon
22: icosikaidigon
23: icosikaitrigon
...
99: nonacontakainonagon
100: hectogon
101: hectakaihenagon
102: hectakaidigon
103: hectakaitrigon
104: hectakaitetragon
105: hectakaipentagon
106: hectakaihexagon
107: hectakaiheptagon
108: hectakaioctagon
109: hectakainonagon
110: hectadecagon
111: hectadecakaihenagon
...
997: nonahectanonacontakaiheptagon
998: nonahectanonacontakaioctagon
999: nonahectanonacontakainonagon

Polygons are named after the number of sides that they have. A pentagon has 5 sides, an
octagon has 8 sides. But how are they named? What's the name for a 248-sided polygon?

All polygons are suffixed with -gon. There are specific prefixes for each polygon depending
on the number of sides. Here are the prefixes for the lower numbers:
3 - tri
4 - tetra
5 - penta
6 - hexa
7 - hepta
8 - octa
9 - nona
10 - deca
11 - undeca
12 - dodeca
13 - triskaideca
14 - tetradeca
15 - pentadeca
16 - hexadeca
17 - heptadeca
18 - octadeca
19 - nonadeca
20 - icosa
Polygons with 21 to 99 sides have a different system. Take the prefix for the tens digit
(found on the left column), the ones digit (right column below), and then stick a "kai"
between them to get (tens)kai(ones)gon.
10 - deca | 1 - hena
20 - icosi | 2 - di
30 - triaconta | 3 - tri
40 - tetraconta | 4 - tetra
50 - pentaconta | 5 - penta
60 - hexaconta | 6 - hexa
70 - heptaconta | 7 - hepta
80 - octaconta | 8 - octa
90 - nonaconta | 9 - nona
The 3-digit sided polygons are named in a similar fashion. A 100-sided polygon is called a
hectogon. Take the hundreds digit, find it on the column for ones digits, then stick a "hecta"
to its right. Now number off the tens and ones like
above: (hundreds)hecta(tens)kai(ones)gon. If the hundreds place digit is a 1, don't put the
prefix behind "hecta"; if the ones place is 0, then omit the (ones) section.
So, given an integer (3 <= n <= 999), return the name of an n-sided polygon. n-gon is not a
valid answer :P
As with all code golf, shortest code wins.

You might also like