Albrecht Dürer was an artist and mathematician who created an engraving of a magic square, where lots of bits all add up to the same thing. Each row, column, quadrant, corners, etc. all add up to 34.
At the bottom, you see 15 and 14, signifying the year it was engraved (1514) as well as 4 and 1, standing for D and A, the creator's initials.
You're going to validate that everything does, in fact, add up.
import numpy as np
square = np.array([
[16, 3, 2, 13],
[5, 10, 11, 8],
[9, 6, 7, 12],
[4, 15, 14, 1],
])
square
array([[16, 3, 2, 13], [ 5, 10, 11, 8], [ 9, 6, 7, 12], [ 4, 15, 14, 1]])
for i in range(4):
assert square[i, :].sum() == 34
assert square[:, i].sum() == 34
assert square[:2, :2].sum() == 34
assert square[2:, :2].sum() == 34
assert square[:2, 2:].sum() == 34
assert square[2:, 2:].sum() == 34
print("All assertions passed!")
All assertions passed!