Monday, January 12, 2026

Is it coftea? Teafee?

I have two glasses, one containing precisely 12 fluid ounces of coffee, the other containing precisely 12 fluid ounces of tea.

I pour one fluid ounce from the coffee cup into the tea cup, and then thoroughly mix the contents. I then pour one fluid ounce from the (mostly) tea cup back into the coffee cup, and then thoroughly mix the contents. Is there more coffee in the tea cup, or more tea in the coffee cup?

In this Classic case, after transferring 1 ounce of coffee to the tea cup, it would have 1 ounce of coffee and 12 ounces of tea. Once thoroughly mixed, each ounce of the liquid would have $1/13$ ounce of coffee and $12/13$ ounce of tea in it. So after moving one ounce back to the coffe cup, the coffee cup would have $11+1/13=144/13$ ounces of coffee and $12/13$ ounces of tea. Conversely, the tea cup would have $1-1/13=12/13$ ounces of coffee and $12-12/13=144/13$ ounces of tea. So after one mixing back and forth the volume of tea in the coffee cup is equal to the volume of coffee in the tea cup.

Monday, December 22, 2025

No $N\times N$ Prime Magic for 2026

Find all values of $N$ for which it is possible to construct an $N$-by-$N$ prime magic square with a magic number of 2026.

The generic update for the magic number formula that we used in the Classic problem states that as long as $j>1$ and $j \mid N^2$, then we can construct an $N\times N$ magic square with magic number $$M_N = M_N(a,j,r,s) = Na + \frac{N}{2} \left( (j-1) r + \left( \frac{N^2}{j} -1\right) s \right),$$ using any natural magic square using numbers $i=1, 2, \dots, N^2$ and mapping $i \leftarrow a_i,$ where $$a_i = a + \left((i-1)\!\!\!\!\! \mod j\right) r+ \Big\lfloor \frac{i-1}{j} \Big\rfloor s, \,\, i=1,\dots, N^2.$$

One thing that we see is that the smallest magic number of for $N\times N$ magic squares occurs for a natural magic square, that is where $a=r=s=1$ and $j=N^2$, and is $$m(N) = \min M_N=\frac{N(N^2+1)}{2}.$$ Since we have $m(16)= 2056 \gt 2026$ we know that we need only search for up to $N\leq 15.$ That said, just as we did for the Classic problem we will lean on some basic number theory.

Firstly, since $2026$ is not a prime, we cannot trivially solve using a $1 \times 1$ magic square that simply contains the number $2026.$ Additionally, there are no $2 \times 2$ magic squares at all, let along prime ones, so we must look for value of $2 \lt N \leq 15$ where there are

Furthermore, we see that besides the $1\times 1$ magic square that only contains $2,$ that any non-trivial prime magic square cannot contain $2,$ and that furthermore both of the differences in the arithmetic progression system, $r$ and $s,$ must be even to hop from one odd prime to another. Therefore, we see that there again exists some $p, q \in \mathbb{Z}$ such that $r=2p$ and $s=2q$ such that \begin{align*}M_N = M_N(a,j,r,s) &= Na + \frac{N}{2} \left( (j-1)r + \left(\frac{N^2}{j} - 1 \right)s \right) \\ &= N \left( a + (j-1) p + \left( \frac{N^2}{j} - 1\right) q \right) \in N\mathbb{Z}.\end{align*} However, since $2026 = 2 \cdot 1013$ and $1013$ is prime, we see that there cannot be any $2 \lt N \leq 15$ such that $N \mid 2026$ and therefore, there are no prime magic squares with a magic number of 2026, for any integer $N.$

This was a lot of null results this week, but lest you think that it is impossible for all numbers, if we close our eyes for a year, then 2027, which is prime will be a trivial $1\times 1$ prime magic square. Additionally, in the not so distant past, we see that 2019 was primally magic with the following $3 \times 3$ magic square:

229 1327 463
907 673 439
883 19 1117

No $4\times 4$ Prime Magic for 2026

A magic square is a square array of distinct natural numbers, where each row, each column, and both long diagonals sum to the same “magic number.” A prime magic square is a magic square consisting of only prime numbers. Is it possible to construct a 4-by-4 prime magic square with a magic number of 2026? If so, give an example; if not, why not?

Well first thing's first. We see from the prompt and from Dürer's engraving that 4-by-4 magic squares do exist. In fact, OEIS A006052 shows that there are 880 distinct natural 4-by-4 magic squares, which contain the numbers $1, 2, \dots, 16,$ that is which a magic number of $$M=\frac{1}{4} \sum_{i=1}^{16} i = 34.$$ The question is whether or not one exists with added constriants of including only prime numbers and having a magic number of $M=2026.$

First we notice that the numbers $1$ through $16$ form an arithmetic progression. With not so much checking (see the figure below), we see that if $$a_i = a + r(i-1), \,\,i= 1,\dots, 16,$$ for some $a, r \in \mathbb{Z},$ that if we replace each integer $i$ in Dü rer's magic square with $a_i$, that we again retrieve a magic square but this time with magic number $$M=M(a,r)=\frac{1}{4} \sum_{i=1}^{16}\left(a+ r(i-1)\right)= 4a+30r.$$ What's more is that we can actually have a system of arithmetic progressions, namely for any $j\gt 1$ with $j \mid 16,$ we can define $$a_i = \begin{cases} a+(i-1)r, & i=1, \dots, j\\ a+(i-j-1)r + s, & i=j+1, \dots, 2j\\ \dots & \\ a + (i+j-17)r + (16/j-1)s, & i=17-j, \dots, 16.\end{cases}$$ We see in the figures below the cases for $j=2$ and $j=16$ (which was the case covered earlier. In this case the generic magic number formula is \begin{align*}M=M(a,j,r,s)&=\frac{1}{4} \sum_{i=1} a_i \\ &= 4a + 2(j-1)r + 2\left( \frac{16}{j} - 1 \right) s.\end{align*}

4-by-4 Magic square with j=16
a+15r a+2r a+r a+12r
a+4r a+9r a+10r a+7r
a+8r a+5r a+6r a+11r
a+3r a+14r a+13r a


4-by-4 Magic square with j=2
a+r+7s a+s a+r a+6s
a+2s a+r+4s a+5s a+r+3s
a+4s a+r+2s a+3s a+r+5s
a+r+s a+7s a+r+6s a

Ok now with all the arts and crafts out of the way lets use the formula for $M=M(a,j,r,s)$ to see if we can end up with any prime magic squares with $M=2026.$ Since we wnat to have a prime square we must have $a$ prime and $a \ne 2.$ Similarly, since we will have a bunch of odd primes in our arithmetic progressions we will need to have the differences $r, s \in 2\mathbb{Z}.$ However, we then quickly see that no matter what value of $j \in \{2, 4, 8, 16\},$ if $r, s \in 2\mathbb{Z},$ then there are $p, q \in \mathbb{Z}$ such that $r=2p$ and $s=2q,$ so we have \begin{align*} M=M(a,j,r,s) &= 4a+2(j-1)r + 2\left(\frac{16}{j}-1\right) s \\ &= 4\left( a + (j-1) p + \left(\frac{16}{j}-1\right) q \right) \in 4\mathbb{Z}.\end{align*} Since $2026 \not\in 4\mathbb{Z}$, there are no prime 4-by-4 magic squares with magic number $M=2026.$

Sunday, December 14, 2025

Toppling Curved Towers

Instead of rectangular prisms, now suppose the tower is part of an annulus. More specifically, it’s the region between two arcs of angle $\theta$ in circles of radius $1$ and $2,$ as shown below.

For small values of $\theta,$ the tower balances on one of its flat sides. But when $\theta$ exceeds some value, the tower no longer balances on a flat side. What is this critical value of $\theta$?

Again, we need to define the center of gravity $(\tilde{x}(\theta), \tilde{y}(\theta))$ and find for what value of $\theta$ do we have $\tilde{x}(\theta) \lt 1.$ Here we should use polar coordinates \begin{align*}x&=\rho \cos \phi \\ y&=\rho \sin \phi\end{align*} to integrate the annular region. We have \begin{align*}\tilde{x}(\theta) &= \frac{\int_0^\theta \int_1^2 \left( \rho \cos \phi \right) \rho \, d\rho \, d\phi}{\int_0^\theta \int_1^2 \rho \,d\rho \,d\phi} \\ &= \frac{ \int_0^\theta \left( \int_1^2 \rho^2 \,d\rho \right) \cos \phi \,d\phi }{ \int_0^\theta \left(\int_1^2 \rho \,d\rho \right) \, d\phi } \\ &= \frac{ \int_0^\theta \frac{2^3 - 1^3}{3} \cos \phi \,d\phi }{ \int_0^\theta \frac{2^2 - 1^2}{2} \,d\phi } \\ &= \frac{ \frac{7}{3} \sin \theta }{ \frac{3}{2} \theta } = \frac{14 \sin \theta}{9 \theta}.\end{align*}

We need to find the solution to the implicit equation $\tilde{x}(\theta) = \frac{14 \sin \theta}{9\theta} = 1.$ Therefore, we find that the point at which the curved tower will topple over is approximately $\theta^* \approx 1.55537048\dots$ radians.

Toppling Towers

A block tower consists of a solid rectangular prism whose height is $2$ and whose base is a square of side length $1$. A second prism, made of the same material, and with a base that’s $L$ by $1$ and a height of $1$, is attached to the top half of the first block, resulting in an overhang as shown below.

When $L$ exceeds some value, the block tower tips over. What is this critical length $L$?

While the problem was stated in three-dimensions, the depth dimension is inconsequential since we will go out on a limb and assume that the solid material that comprises the blocks is uniformly dense. Let's define the coordinate system as the right corner of the 1 x 2 block is at the origin, so that the left corner of the 1x2 block is at $(-1,0)$ and far left corner of the horizontal block is at $(-L-1, 2).$ The block tower tips over if and only if the center of gravity of the tower falls outside of the support the 1x2 block. That is, if $(\tilde{x}(L), \tilde{y}(L))$ is the center of gravity of the full tower, then the tower will fall over if and only if $\tilde{x}(L) \lt -1.$

So we've taken a three dimensional problem and reduced it down to a one dimensional problem. All we have left to do is to compute $\tilde{x}(L),$ so .... let's do that. Let's conveniently define the density so that the weight of the 1x2 block is $2$ units and the other block is $L$ units. The $x$-coordinate of the 1x2 block is at $-\frac{1}{2},$ while the $x$-coordinate of the second block is at $-\frac{L+2}{2}.$ Therefore we have $$\tilde{x}(L) = \frac{\left(-\frac{1}{2}\right) 2 + \left(-\frac{L+2}{2} \right) L}{L + 2} = -\frac{L^2 + 2L + 2}{2(L+2)}.$$ Therefore, we need to solve when $$-\frac{L^2 + 2L + 2}{2(L+2)} \lt -1,$$ which is equivalent to $L^2 - 2 \gt 0,$ so the critical length above which the tower will topple over is $L^* = \sqrt{2}.$

Monday, December 8, 2025

Sure, a bullseye is a bullseye, but what's the average?

Suppose each point on the dartboard is equally likely to be hit by a dart. On average, what score would you expect a single dart to earn?

Let $E = \mathbb{E} [ S ]$ be the average score of a single dart. Based on the setup of the Apollonian gasket, we see that there are infinitely many circles which are only contained within the unit circle. Let's say that we enumerate the radii as $r_n, n \in \mathbb{N},$ say with $r_0 = 1$, $r_1 = r_2 = \frac{1}{2},$ etc. One important point is that the smaller circles entirely contained within the unit eventually mutually exclusively cover the entirety of the unit circle, so however we enumerate them we must have $$\sum_{n=1}^\infty r_n^2 = 1.$$ Additionally, we see that the Apollonian gasket is symmetric about the $x$-axis and about the $y$-axis, so as we are filling things up we can focus on say just enumerating all of the cicles in say the first quadrant and then using symmetrical arguments to fill in the rest.

Additionally, since each circle with radius, say $r_n,$ is then filled with a scaled copy of the Apollonian gasket we see that $$\mathbb{E} [ S \mid r_n ] = \pi + r_n^2 E,$$ since in addition to the scaled copy of the expectation the only other circle that adds to the score is the unit circle. From a law of total expectation, since $$\mathbb{P} [ r_k ] = \frac{\pi r_n^2}{\pi} = r_n^2,$$ we have $$E = \sum_{n=1}^\infty r_n^2 \left( \pi + r_n^2 E \right) = \pi + E \sum_{n=1}^\infty r_n^4,$$ or equivalently $$E = \frac{\pi}{1 - \sum_{n=1}^\infty r_n^4}.$$

Actually, with all of that setup out of the way, let's speak in terms of curvatures $k_n = \frac{1}{r_n}, n \in \mathbb{N},$ where $k_0 = -1$ (since it is encompassing all of the other circles of the gasket). From Descartes' theorem -- or from Soddy's The Kiss Precise, whichever format speaks to your soul best -- we see that if you have three mutually tangent circles, with curvatures $k_\ell$, $k_m,$ $k_n$ then you can find two circles which are mututally tangent to the other three with curvatures $k_\pm,$ satisfying the equation $$(k_\ell + k_m + k_n + k_\pm)^2 = 2 \left( k_\ell^2 + k_m^2 + k_n^2 + k_\pm^2 \right).$$ In particular, we have $$k_\pm = k_\ell + k_m + k_n \pm 2 \sqrt{ k_\ell k_m + k_\ell k_n + k_m k_n }.$$ In particular, if we start with smaller curvatures (bigger radii) and work our way smaller and smaller, we can focus on just the solution $k_+$ since $k_-$ will have already been enumerated. In this way we can enumerate the first $N=84$ largest circles, once symmetry is taken into account, which correspond to the $20$ smallest curvatures. Note that the next largest circle has a curvature of $m_N = \min_{n \geq N+1} k_n = 62.$

Now we see that $$\theta_N = \sum_{n=1}^N r_n^2 \approx 0.955398049382331\dots$$ and $$\phi_N = \sum_{n=1}^N r_n^4 \approx 0.153282259694304\dots.$$ We additionally have $$\sum_{n=N+1}^\infty r_n^4 \leq \left(\max_{n \geq N+1} r_n^2 \right) \left( \sum_{n=N+1}^\infty r_n^2 \right) = \frac{1 - \theta_N}{m_N^2} \approx 0.0000116030048433062\dots.$$ Therefore, we have $$ 1.181031 \pi \approx \frac{\pi}{1-\phi_N} \leq E \leq \frac{\pi}{1 - \phi_N - \frac{1-\theta_N}{m_N^2}} \approx 1.181047 \pi.$$ Therefore, despite the fact that I could do a lot more enumeration and even get some good infinite sequences going based on the recursion formulae above, we see that the expected value of the score of one dart is approximately $$ E \approx 1.1810 \pi \approx 3.7103\dots.$$

Sunday, December 7, 2025

A bullseye is a bullseye is a bullseye

You are playing darts with your friend, Apollonius, who has brought his own dartboard. However, this dartboard is somewhat … different. Instead of being a circle divided into concentric rings and sectors, the dartboard is a unit circle (i.e., with radius 1) that’s divided via an Apollonian gasket. In particular, this gasket is defined by two horizontally adjacent, congruent circles with radius 1/2.

But that’s not all! Every circle on the dartboard, no matter how small, is also its own Apollonian sub-gasket. Like the larger circle, every gasket, sub-gasket, sub-sub-gasket, etc., are defined by two horizontally adjacent, congruent circles with radii that are half the radius of their outer circle.

Now, when you throw a dart at this board, your score is the sum of the areas of every circle for which the dart lies inside or on the circumference. (Remember, the entire board is a unit circle.) What is the most a single dart can score?

Well as long as you hit the board at all you score $\pi$, so that's good. We note that if our dart hits the circumference of some circle, say with radius $r$, then there must be at lest some other circle, and in fact due to the nested Apollonian gaskets, infinitely many other circles of which this point is on the circumference. In particular, by recursion, if the dart lands at the point $z_0 + r_0 e^{i\theta}$ for some center, $z_0$, such that $\|z_0\|_2 \lt 1,$ and radius $r_0 \lt 1$, then there are infinitely many more circles $z_k + r_k e^{i\theta},$ where $r_k \leq \frac{1}{2^k}r_0,$ since all of the subcircles in the gasket have radius less than half of their outer circle, for some center $z_k$ satisfying $\|z_k - z_0\|_2 \lt r_0.$ Let's assume that the dart lands at the point of intersection between a circle of radius $r_1$ and a circle of radius $r_2,$ and that the smallest circle in the nested Apollonian gaskets that contains both of these circles is the unit circle, then the total score is $$S(r_1,r_2) \leq \pi + \sum_{n=0}^\infty \frac{\pi r_1^2}{4^n} + \sum_{m=0}^\infty \frac{\pi r_2^2}{4^m} = \pi \left( 1 + \frac{4}{3} \left( r_1^2 + r_2^2 \right) \right).$$

If we take any radii $r_1$, $r_2$ that appear in the Apollonian subgasket, then we get $$ \max S(r_1,r_2) \leq \max_{r_1, r_2} \pi \left( 1 + \frac{4}{3} \left(r_1^2 + r_2^2\right) \right) = \frac{5\pi}{3},$$ since $r_1, r_2 \leq \frac{1}{2}.$ On the other hand, if we get a bullseye, which sits exactly at the origin, then this sits in the circles indexed with centers at $z_k = (\textsf{sgn}(k) \frac{1}{2^{|k|}}, 0 )$ and radii $r_k = \frac{1}{2^{|k|}},$ for all $k \in \mathbb{Z}.$ So the score at the origin is $$S_0 = \sum_{k \in \mathbb{Z}} \pi \frac{1}{4^{|k|}} = \pi + 2\pi \sum_{k=1}^\infty \frac{1}{4^k} = \pi + 2\pi \frac{\frac{1}{4}}{1 - \frac{1}{4}} = \frac{5\pi}{3}.$$ Therefore, the bound is sharp and we must have that the maximum possible score of the dart, which occurs at a bullseye, is $\frac{5\pi}{3} \approx 5.235987756\dots.$