import math
import matplotlib
from matplotlib.patches import Rectangle as RE
import matplotlib.pyplot as plt
odds = [2*i+1 for i in range(1,51)]
for i in range(49) :
for j in range(i, 50) :
for a in [1,3,5,7,9] :
for b in [1,3,5,7,9] :
x = odds[i]
y = odds[j]
t = a*x + b*y + 2*x*y
k = math.log2(t)
if k == int(k) :
print(a,x, b,y, k)
3 3 5 5 6.0 5 3 1 7 6.0 3 3 1 17 7.0 3 3 7 19 8.0 1 3 5 23 8.0 5 3 1 71 9.0 7 5 7 13 8.0 7 5 3 17 8.0 5 5 1 21 8.0 1 5 3 39 9.0 9 5 1 89 10.0 7 7 9 9 8.0 5 7 3 13 8.0 5 7 9 43 10.0 3 7 3 59 10.0 7 7 1 65 10.0 1 9 1 13 8.0 9 9 5 41 10.0 7 11 7 15 9.0 9 11 3 37 10.0 3 11 9 65 11.0 7 11 5 73 11.0 7 17 7 97 12.0 7 23 5 37 11.0 1 25 9 69 12.0 3 27 1 73 12.0 9 29 7 59 12.0 9 29 1 65 12.0 5 39 5 47 12.0 3 39 7 95 13.0 7 41 3 93 13.0 3 47 3 83 13.0
v = {3: "#FDE725FF",
5: "#3CBB75FF",
15: "#2D708EFF",
17: "#481567FF"}
#Square at (x,y) with side l and fontsize s.
def square(x, y, l, s) :
ax.add_patch(RE(xy = (x, y),
width = l,
height = l,
fc = v[l],
ec = 'k',
lw = 1.5,
alpha = 0.8,
zorder = 2))
plt.text(x+l/2,
y+l/2,
str(l),
c = 'k',
ha = 'center',
va = 'center',
**{'size': s})
def remove(ax):
#Remove axes and ticks.
for side in ['bottom', 'left', 'top', 'right']:
ax.spines[side].set_visible(False)
ax.set_xticks([])
ax.set_yticks([])
matplotlib.rc_file_defaults()
fig = plt.figure(figsize = (10, 10))
ax = fig.add_subplot(111, xlim = (-0.04, 18.04), ylim = (-0.04, 18.04))
remove(ax)
for i in [0, 5, 10] :
for j in [0, 5, 10] :
square(i, j, 5, 45)
for j in [0,3,6,9,12,15] :
square(j, 15, 3, 35)
square(15, j, 3, 35)
fig.savefig('2024.05.10 Fiddler.png');
matplotlib.rc_file_defaults()
fig = plt.figure(figsize = (12, 12))
ax = fig.add_subplot(111, xlim = (-0.04, 32.04), ylim = (-0.04, 32.04))
remove(ax)
square(0, 0, 15, 50)
for i in [0, 5, 10] :
square(i, 15, 5, 40)
square(27, i, 5, 40)
for j in [0, 3, 6, 9, 12] :
for k in [0, 3, 6, 9] :
square(j, 20+k, 3, 35)
square(24-k, j, 3, 35)
square(15, 15, 17, 55)
fig.savefig('2024.05.10 EC.png');