Agnes Scott College
Larry Riddle, Agnes Scott College
image

Right Triangle Divided by Nine Count

Details

triangles removed1234567
number of fractals6214769694721

The triangles are numbered as follows:

code

Here is a Python program for counting the number of fractals, where two fractals that are mirror images across a vertical reflection are counted only once. The integers correspond to the triangles that are removed as indicated in the diagram above.

from itertools import combinations
a = [1,2,3,4,5,6,7,8,9]
m = 3                       # number of rectangles to remove
b = list(combinations(a,m)) # all 9 choose m combinations in lexicographical order
b2 = [list(x) for x in b]
c = []
dic = {3:1, 6:5, 7:4, 1:3, 5:6, 4:7}  # dictionary for symmetric locations
for k in range(len(b2)):
    d = [dic.get(n,n) for n in b2[k]] # replace triangles in kth item with symmetric locations
    d.sort()                          # put in lexographic order after swap
    if d not in b2[0:k]:              # check if already in list up to kth position
        c.append(b2[k])               # if not, append to the list
c2 = [tuple(x) for x in c]
print(c2)           
print(len(c2))

The output is shown in the following table:

mRemove the following trianglesCount
1[(1,), (2,), (4,), (5,), (8,), (9,)]6
2 [(1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), (2, 4), (2, 5), (2, 8), (2, 9), (4, 5), (4, 6), (4, 7), (4, 8), (4, 9), (5, 6), (5, 8), (5, 9), (8, 9)] 21
3 [(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 2, 6), (1, 2, 7), (1, 2, 8), (1, 2, 9), (1, 3, 4), (1, 3, 5), (1, 3, 8), (1, 3, 9), (1, 4, 5), (1, 4, 6), (1, 4, 7), (1, 4, 8), (1, 4, 9), (1, 5, 6), (1, 5, 7), (1, 5, 8), (1, 5, 9), (1, 6, 7), (1, 6, 8), (1, 6, 9), (1, 7, 8), (1, 7, 9), (1, 8, 9), (2, 4, 5), (2, 4, 6), (2, 4, 7), (2, 4, 8), (2, 4, 9), (2, 5, 6), (2, 5, 8), (2, 5, 9), (2, 8, 9), (4, 5, 6), (4, 5, 7), (4, 5, 8), (4, 5, 9), (4, 6, 8), (4, 6, 9), (4, 7, 8), (4, 7, 9), (4, 8, 9), (5, 6, 8), (5, 6, 9), (5, 8, 9)] 47
4 [(1, 2, 3, 4), (1, 2, 3, 5), (1, 2, 3, 8), (1, 2, 3, 9), (1, 2, 4, 5), (1, 2, 4, 6), (1, 2, 4, 7), (1, 2, 4, 8), (1, 2, 4, 9), (1, 2, 5, 6), (1, 2, 5, 7), (1, 2, 5, 8), (1, 2, 5, 9), (1, 2, 6, 7), (1, 2, 6, 8), (1, 2, 6, 9), (1, 2, 7, 8), (1, 2, 7, 9), (1, 2, 8, 9), (1, 3, 4, 5), (1, 3, 4, 6), (1, 3, 4, 7), (1, 3, 4, 8), (1, 3, 4, 9), (1, 3, 5, 6), (1, 3, 5, 8), (1, 3, 5, 9), (1, 3, 8, 9), (1, 4, 5, 6), (1, 4, 5, 7), (1, 4, 5, 8), (1, 4, 5, 9), (1, 4, 6, 7), (1, 4, 6, 8), (1, 4, 6, 9), (1, 4, 7, 8), (1, 4, 7, 9), (1, 4, 8, 9), (1, 5, 6, 7), (1, 5, 6, 8), (1, 5, 6, 9), (1, 5, 7, 8), (1, 5, 7, 9), (1, 5, 8, 9), (1, 6, 7, 8), (1, 6, 7, 9), (1, 6, 8, 9), (1, 7, 8, 9), (2, 4, 5, 6), (2, 4, 5, 7), (2, 4, 5, 8), (2, 4, 5, 9), (2, 4, 6, 8), (2, 4, 6, 9), (2, 4, 7, 8), (2, 4, 7, 9), (2, 4, 8, 9), (2, 5, 6, 8), (2, 5, 6, 9), (2, 5, 8, 9), (4, 5, 6, 7), (4, 5, 6, 8), (4, 5, 6, 9), (4, 5, 7, 8), (4, 5, 7, 9), (4, 5, 8, 9), (4, 6, 8, 9), (4, 7, 8, 9), (5, 6, 8, 9)] 69
5 [(1, 2, 3, 4, 5), (1, 2, 3, 4, 6), (1, 2, 3, 4, 7), (1, 2, 3, 4, 8), (1, 2, 3, 4, 9), (1, 2, 3, 5, 6), (1, 2, 3, 5, 8), (1, 2, 3, 5, 9), (1, 2, 3, 8, 9), (1, 2, 4, 5, 6), (1, 2, 4, 5, 7), (1, 2, 4, 5, 8), (1, 2, 4, 5, 9), (1, 2, 4, 6, 7), (1, 2, 4, 6, 8), (1, 2, 4, 6, 9), (1, 2, 4, 7, 8), (1, 2, 4, 7, 9), (1, 2, 4, 8, 9), (1, 2, 5, 6, 7), (1, 2, 5, 6, 8), (1, 2, 5, 6, 9), (1, 2, 5, 7, 8), (1, 2, 5, 7, 9), (1, 2, 5, 8, 9), (1, 2, 6, 7, 8), (1, 2, 6, 7, 9), (1, 2, 6, 8, 9), (1, 2, 7, 8, 9), (1, 3, 4, 5, 6), (1, 3, 4, 5, 7), (1, 3, 4, 5, 8), (1, 3, 4, 5, 9), (1, 3, 4, 6, 8), (1, 3, 4, 6, 9), (1, 3, 4, 7, 8), (1, 3, 4, 7, 9), (1, 3, 4, 8, 9), (1, 3, 5, 6, 8), (1, 3, 5, 6, 9), (1, 3, 5, 8, 9), (1, 4, 5, 6, 7), (1, 4, 5, 6, 8), (1, 4, 5, 6, 9), (1, 4, 5, 7, 8), (1, 4, 5, 7, 9), (1, 4, 5, 8, 9), (1, 4, 6, 7, 8), (1, 4, 6, 7, 9), (1, 4, 6, 8, 9), (1, 4, 7, 8, 9), (1, 5, 6, 7, 8), (1, 5, 6, 7, 9), (1, 5, 6, 8, 9), (1, 5, 7, 8, 9), (1, 6, 7, 8, 9), (2, 4, 5, 6, 7), (2, 4, 5, 6, 8), (2, 4, 5, 6, 9), (2, 4, 5, 7, 8), (2, 4, 5, 7, 9), (2, 4, 5, 8, 9), (2, 4, 6, 8, 9), (2, 4, 7, 8, 9), (2, 5, 6, 8, 9), (4, 5, 6, 7, 8), (4, 5, 6, 7, 9), (4, 5, 6, 8, 9), (4, 5, 7, 8, 9)] 69
6 [(1, 2, 3, 4, 5, 6), (1, 2, 3, 4, 5, 7), (1, 2, 3, 4, 5, 8), (1, 2, 3, 4, 5, 9), (1, 2, 3, 4, 6, 8), (1, 2, 3, 4, 6, 9), (1, 2, 3, 4, 7, 8), (1, 2, 3, 4, 7, 9), (1, 2, 3, 4, 8, 9), (1, 2, 3, 5, 6, 8), (1, 2, 3, 5, 6, 9), (1, 2, 3, 5, 8, 9), (1, 2, 4, 5, 6, 7), (1, 2, 4, 5, 6, 8), (1, 2, 4, 5, 6, 9), (1, 2, 4, 5, 7, 8), (1, 2, 4, 5, 7, 9), (1, 2, 4, 5, 8, 9), (1, 2, 4, 6, 7, 8), (1, 2, 4, 6, 7, 9), (1, 2, 4, 6, 8, 9), (1, 2, 4, 7, 8, 9), (1, 2, 5, 6, 7, 8), (1, 2, 5, 6, 7, 9), (1, 2, 5, 6, 8, 9), (1, 2, 5, 7, 8, 9), (1, 2, 6, 7, 8, 9), (1, 3, 4, 5, 6, 7), (1, 3, 4, 5, 6, 8), (1, 3, 4, 5, 6, 9), (1, 3, 4, 5, 7, 8), (1, 3, 4, 5, 7, 9), (1, 3, 4, 5, 8, 9), (1, 3, 4, 6, 8, 9), (1, 3, 4, 7, 8, 9), (1, 3, 5, 6, 8, 9), (1, 4, 5, 6, 7, 8), (1, 4, 5, 6, 7, 9), (1, 4, 5, 6, 8, 9), (1, 4, 5, 7, 8, 9), (1, 4, 6, 7, 8, 9), (1, 5, 6, 7, 8, 9), (2, 4, 5, 6, 7, 8), (2, 4, 5, 6, 7, 9), (2, 4, 5, 6, 8, 9), (2, 4, 5, 7, 8, 9), (4, 5, 6, 7, 8, 9)] 47
7 [(1, 2, 3, 4, 5, 6, 7), (1, 2, 3, 4, 5, 6, 8), (1, 2, 3, 4, 5, 6, 9), (1, 2, 3, 4, 5, 7, 8), (1, 2, 3, 4, 5, 7, 9), (1, 2, 3, 4, 5, 8, 9), (1, 2, 3, 4, 6, 8, 9), (1, 2, 3, 4, 7, 8, 9), (1, 2, 3, 5, 6, 8, 9), (1, 2, 4, 5, 6, 7, 8), (1, 2, 4, 5, 6, 7, 9), (1, 2, 4, 5, 6, 8, 9), (1, 2, 4, 5, 7, 8, 9), (1, 2, 4, 6, 7, 8, 9), (1, 2, 5, 6, 7, 8, 9), (1, 3, 4, 5, 6, 7, 8), (1, 3, 4, 5, 6, 7, 9), (1, 3, 4, 5, 6, 8, 9), (1, 3, 4, 5, 7, 8, 9), (1, 4, 5, 6, 7, 8, 9), (2, 4, 5, 6, 7, 8, 9)] 21

Click here to see all the fractals when 1, 2, or 3 triangles are removed, and the 8 symmetric fractals when 4 triangles are removed.