**How many distinct patterns can you create with a thread while sewing on a four-hole button?**

Unfortunately, there is no information on the Web what the answer was and had Kolmogorov found it himself. In a book about Grigori Perelman, the author Masha Gessen admitted that two professional mathematicians, both former students of Kolmogorov, had given different answers.

We have found the number of patterns

**p**in several cases where single-color thread was involved. We have also found the number of patterns in several cases where threads of different colors

**c**were used, including the case where the buttonholes were located on the vertices of a generic convex

**n**-gon (i.e. a convex

**n**-gon with no more than two diagonals intersecting at any point in its interior). Now, let us try the more complicated case involving different color threads and buttonholes located on the vertices of a regular convex

**n**-gon and generalize our findings with respect to all convex

**n**-gons.

__Assumptions:__

A1. It is mandatory to utilize the buttonholes. There are many ways to sew on a button without utilizing the buttonholes but let us forget about them for the time being.

A2. All

**n**buttonholes are located on the vertices of a regular convex

**n**-gon.

A3. Different-color threads might be used for different segments between the buttonholes. Let us use the adjective

*painted*for a segment that is covered by a thread and the verb

*paint*for the action itself.

A4. Only buttonhole-to-buttonhole connections are used. No cross-border connections are allowed.

__Calculation:__

1. Some of the regular convex

**n**-gons are generic ones – those, whose number of vertices is an odd number (

**n = 2q+1**) plus the square, where

**n=4**. We have already found that for the generic convex

**n**-gons the number of patterns

**p**is

**p = -1 +**

as all possible intersections, totaling

**{****(c+1)^[(1/2)*(n-1)*n]}*[c*(c-1)]^C(n,4)****C(n,4)**, must be counted twice when 2 differently painted diagonals, totaling

**c*(c-1)**, intersect (as 2 different patterns exist for every 2 colors, which you can see below).

**n**-gons where

**n**is an even number greater than

**4**(i.e. when

**n=2q**and

**q>2)**.

2. Thanks to Bjorn Poonen and Michael Rubinstein and their beautiful article

__“THE NUMBER OF INTERSECTION POINTS MADE BY THE DIAGONALS OF A REGULAR POLYGON”__we know some things about regular polygons that we can use now:

a) When

**n=2q**the number of diagonals intersecting at a point (except for the center of the

**n**-gon) may be 2, 3, 4, 5, 6 or 7;

b) When

**n=2q**the number of diagonals intersecting at the center of the

**n**-gon is

**n/2**.

3. The number of intersection points

**I(n)**of the diagonals can be represented in the following manner:

**I(n) = i(2)+i(3)+i(4)+i(5)+i(6)+i(7)+i(n/2)**,

where

**i(k)**,

**(k = 2, …, 7)**, is the number of points where

**k**diagonals intersect and

**i(n/2)**is the center of the regular

**n**-gon where

**n/2**diagonals intersect (in the case of

**n = 2q**,

**q >1**). Therefore,

**i(n/2)**must be separately counted only in the cases where

**n = 2q**and

**q > 7**.

4. In it. 1 above, we saw that two different-color threads (e.g. red and green) look differently when the threads intersect (depending on which one is on top of the other). The same is true when the number of different-color threads is 3, 4 and more (see below how many patters are there when 3 differently painted diagonals intersect at a point).

5. Based on items 2, 3 and 4 above the formula listed in it. 1 above takes the following form:

**p = -1 + (M1*M2*M3)**, where

and where

**-1**stands for the case when the button is attached to the cloth only by “0-color” threads, i.e. the case where the button is not attached at all.

6. This formula could be used for any convex

**n**-gon, as long as we remember that in the cases of

**n=2q+1**, as well as in the cases of

**n=2q**and

**q≤7**, we do not need to multiply by the third term (i.e. by

**M3**) as the central intersection point either does not exist (when

**n=2q+1**) or had already been handled (when

**n=2q**and

**q≤7**).

__Additional observation:__

Generally, we can see great many things with our eyes, but cannot see everything. A separate text will address the interesting and more complicated situation related to the number of patterns when the button is looked at under a magnifying glass or a microscope.