This is part of live presentation series called Mathematical Games in which we explore a variety of games and puzzles using Wolfram Language. In this episode, we explore games that involve colors and combinatorics.

demonstrations.wolfram.com

Many Demonstrations use combinatorics.

New Perfect Number Found!

A perfect gaussian integer, found by Angel Sanchez Solovieva.
In[]:=
2(430089+665198I)==Total[Divisors[430089+665198I]]
Out[]=
True
In[]:=
FactorInteger[430089+665198I]
Out[]=
{{-1,1},{1+2,3},{5+2,1},{38+17,1},{316+5,1}}
In[]:=
Divisors[430089+665198I]
Out[]=
{1,1+2,1+12,4+3,4+93,5+2,11+2,14+23,38+17,51+32,101+182,141+1112,156+161,256+3797,306+637,316+5,384+263,473+166,799+29408,1249+968,1394+2083,1570+657,3466+687,4309+7338,11923+5562,15956+10367,31006+58017,38996+352097,48491+51656,120029+85028,148638+54821,430089+665198}
T[q_]:=Total[Divisors[q]];
Here’s an divisor that’s not far from perfect:
In[]:=
q=1394+2083;​​r=2q-T[q]
Out[]=
9+13
That can be used to get another divisor:
In[]:=
p=T[q]/r
Out[]=
316+5
Which returns the original number:
In[]:=
pq
Out[]=
430089+665198

No-3-in-line 76!

Marijn Heule gets 76 points on the grid. 75 is the smallest grid currently unsolved.
Out[]=
The Hopf conjecture has a counterexample
One version of the famous Hopf conjecture says that S^2 x S^2, the product of two ordinary spheres, cannot have positive sectional curvature. A new preprint by Simon Brendle and Pei-Ken Hung claims a counterexample: A Metric on S^2 x S^2 with Positive Sectional Curvature (2026), https://arxiv.org/abs/2608.19068 .
Sectional curvature is tested at every point and in every two-dimensional tangent direction. For the standard product metric, planes tangent to either sphere have positive curvature, but mixed planes containing one direction from each sphere are flat. Hopf's conjecture was that some flat or negatively curved direction must survive every possible choice of metric.
The problem has resisted attacks since at least the early 1970s. Bourguignon, Deschamps, and Sentenac studied perturbations of product metrics in 1972. Cheeger constructed nonnegatively curved metrics in 1973, and Mueter analyzed the resulting deformations in 1987. Hsiang and Kleiner proved in 1989 that a closed positively curved four-manifold with a continuous symmetry must be homeomorphic to S^4 or CP^2. Consequently, any successful metric on S^2 x S^2 must break its continuous symmetries.
In their proposed construction, Brendle and Hung begin with a Cheeger-Mueter metric. At a generic point, every tangent two-plane has positive sectional curvature except for exactly one zero-curvature plane. They perturb the metric in three orders:
g[s] = g + s h1 + s^2 h2 + s^3 h3
The first variation of the minimum curvature is zero. The second variation is nonnegative and is positive away from a special two-dimensional torus Sigma. On Sigma, the second variation still vanishes, so the decisive information occurs at third order.
The companion Mathematica supplement computes the coefficient of lambdaC lambdaD^2 in the third variation. On either component of the exceptional torus, parameterized by 0 < theta < Pi/2 and 0 <= phi < 2 Pi, the four contributions satisfy
A1 = A2 = 0
A3 = Cos[2 theta] Cos[2 phi]/(3 (7 - Cos[4 theta]))
A4 = 1/36 - Cos[2 theta] Cos[2 phi]/(6 (7 - Cos[4 theta]))
Their sum is the following explicit function. This is a quantity actually calculated in the supplement, not a schematic curvature profile.

Plot the third-order coefficient

Out[]=
Integral over both torus components =
2
π
18
3
On the generic parameter range 0 < theta < Pi/2, this coefficient is strictly positive. Its continuous extension to the closed parameter rectangle has minimum zero at four boundary parameter values, so it should not be identified with the final positive curvature. The exact integral is Pi^2/(18 Sqrt[3]). This nonzero integral shows that the integral of the full third variation is a nonzero polynomial in the perturbation parameters for a generic choice of those parameters.

The Laplacian correction

A nonzero average is not enough: the third variation could still vary across Sigma. The authors use a standard fact about the Laplacian on a compact torus. If a smooth function has mean zero, it is the Laplacian of another smooth function.
V3 = mu + DeltaSigma[chi]
Here mu is the average value of V3 on Sigma. The difference V3 - mu has integral zero, so the Poisson equation DeltaSigma[chi] = V3 - mu has a smooth solution. In the coordinates used in the paper, m3 = partial_phi and m4 = partial_theta on Sigma, giving
DeltaSigma[chi] = 3 D[chi, {phi, 2}] + D[chi, {theta, 2}]
They extend chi smoothly away from Sigma and choose the third-order metric correction h3 = 6 chi g. Its effect on the third curvature variation is subtraction of DeltaSigma[chi]:
correctedV3 = V3 - DeltaSigma[chi] = mu
The correction does not merely raise a graph. It removes the varying, mean-zero part of the third variation and leaves its nonzero average as a constant over the entire exceptional torus.

Visualize the mean-zero decomposition of the explicit coefficient

For the single coefficient f calculated above, the average is mu = 1/36. The following graphic shows the algebraic decomposition of f into its constant average and mean-zero part. This is an illustration only: it does not construct the smooth function chi or the full third-order metric correction, which depend on the complete V3 after the perturbation parameters are chosen.
Out[]=
All Sporadic Groups are Galois Groups
Constructions published between 1984 and 1989 purported to realize 25 of the 26 sporadic groups as Galois groups over Q. The Mathieu group M23, the sixth-smallest sporadic group with group order 10200960, remained the sole exception until Huang et al. (2026) constructed a regular Galois extension of Q(t) with Galois group M_(23).

8-reptile Tetrahedra

This is an older problem, but the third solution is new to me. I started out making this talk about old problems.
There are three tetrahedra that will make larger copies of themselves:
We can go to the next level.
Moser’s Circle Problem A000127 (MW, Wiki)
Points on a circle are connected. What’s the highest number of regions? 1, 2, 4, 8, 16, ??
Best we can do is 31 regions. It’s a classic warning to not jump to conclusions too soon.
The sequence of maximal pieces is a sum of binomials.
For 4 points, up to 6 regions can have equal area.
Lazy caterer’s problem A000124 (MW, Wiki)
What is the maximum number of pieces made by n straight cuts of a disk?
The answer is one more than a triangular number.
Let’s make the problem harder. What’s the largest size for the smallest piece? Here are my best solutions:
In 2025, the paper Cutting a Pancake with an Exotic Knife was released. There are many exotic cuttings. How many regions can you get with two W cuts?
Graph crossing number A000241 (MW, Wiki)
The Harary–Hill/Guy formula is strongly supported but remains unproved in general.
Marcus Schaefer’s 2022 survey is a useful map of the field. 2022 survey.
Curvy Graph (MW)
After consulting with Eric Weisstein, he agreed that graphs with rcr(G)>cr(G) deserved a name. He called them curvy graphs, much better than “crossing-divergent”

Curvy Graphs

There are two critical cases where the cn(g) < rcn(g). The 16-cell is a subgraph of the Turan graph. Whether there are more minimal curvy graphs is an open question.
Lattice kissing number A001116 (MW, Wiki)
A circle can be surrounded by six others.
Here, the central sphere has radius .9
Values are known up to the 9th dimension.
For the 4th dimension, Gauss found the tightest packing.
The points make an object known as the 24-cell. Projected into 3D:

A recent AI proof improves a hypersphere packing result.

Salem-Spencer Nonaveraging sets A065825 (MW, Wiki)

In 1, 3, 4, 8, 9, 11, 20, 22, 23, 27, 28, 30 ... no term is the average of two other terms. That makes it a nonaveraging sequence. This is the unique such positive integer sequence with lowest term 1 and highest term 30, and it’s impossible to do it with the highest term being lower than 30. This is an example of extremal combinatorics.

Galois Field Caverns

With primitive polynomials, it’s not too hard to get all the polynomials of a particular power.
Here’s an example. A primitive polynomial is a polynomial that generates all elements.
The primitive polynomial generated all the possible polynomials of the binary field.
The 18, 16, 48, 60, and 176 primitive polynomials of GF[2^7], GF[2^8], GF[2^9], GF[2^10] and GF[2^11]×2 can be arranged to make caverns.
In 1938, James Singer found that all possible distances could be put on circular arcs, perfectly.
If a circular wheel is used, a perfect set of measuring marks is called a difference set, a Ganymede circle, or an n-switch. All the distances between selected red points are different. The distances are indicated by arcs inside the circle.
Here are 13 parabolas, each on 4 points.
Here are 13 points, each on 4 parabolas. Based on Isaac Newton’s parabola method.
From FourPointParabolas.
Optimal Golomb ruler A003022 (MW, Wiki)
Place n marks on a ruler so that every pairwise distance is distinct, while minimizing total length. A003022 gives the optimal length.
The optimization is elementary to state and notoriously expensive to certify.
The 28-mark optimum was certified in 2022–2023. Thousands of years of computer time verified a solution found James B. Shearer in 1986. He used a 1938 method by James Singer.
T. Rokicki and G. Dogon, “Possibly Optimal Golomb Rulers Calculated for 160 to 40,000 Marks,” (Jul 7, 2016) cube20.org/golomb.
Sidon Sets and Singer Constructions
A new bound?
A Sidon set is a set of integers in which all unordered pairwise sums are distinct. For example,
is a Sidon set. Equivalently, its ten positive differences are
with no repetition. Viewed as marks on a ruler, this is an optimal five-mark Golomb ruler of length 11.

Singer constructions and verified rulers

Among the Golomb rulers whose optimality has been proved--currently through 28 marks--the only orders not matched by these projective or affine constructions are
The last exception is the optimal 16-mark ruler
The best Singer-type construction at order 16 has length 179, two units longer. From order 17 through order 28, every ruler subsequently proved optimal is generated by one of the finite-field constructions.
The exhaustive distributed computation proving optimality at order 28 took eight and a half years on thousands of computers. Distributed.net This vast effort verified a solution predicted years earlier by Singer’s methods.
Rokicki and Dogon’s Cube20 project searched the relevant projective and affine constructions through 40,000 marks and published the resulting best-known rulers. No better ruler with more than 16 marks is presently known outside these construction families.

Bounds

Singer's finite-projective-plane construction gives the asymptotic lower bound
The current published upper bound by Carter-Hunter-O’Bryant is
Assuming Cube20 data rulers are optimal, the published coefficient 0.98183 can be replaced over large finite ranges by
and, on the final part of that range,
Sparse ruler A046693 (MW, Wiki)
Choose the fewest ruler marks so that every integer distance up to the ruler length occurs.
Gardner: Eight marks, the minimum, can be placed on a yardstick in such a way that all integral lengths from 1 through 36 can be measured.
They are placed at 1,3,6,13,20,27,31,35. This solution was first found by John Leech, who gave it in his classic paper on this problem,
“On the Representation of 1,2, . . . , n by Differences,”Journal of the London Mathematical Society 31 (1956):160-169.
Postage stamp problem A001212 A004129 (MW, Wiki)
A problem I worked on recently.
GARDNER 4. Coins of the Realm​
In this country at least eight coins are required to make the sum of 99 cents: a
half-dollar, a quarter, two dimes arid four pennies. Imagine yourself the leader of a
small, newly independent nation. You have the task of setting up a system of coinage
based on the cent as the smallest unit. Your objective is to issue the smallest number of
different coins that will enable any value from 1 to 100 cents (inclusive) to be made
with no more than two coins.
Here’s a set of stamps that covers up to 104. The 2 stamps can be the same.
There is a palindromic pattern to the numbers:
Here’s a set of stamps that covers up to 129. The 2 stamps cannot be the same.
There is a pattern to the numbers:
Postage stamp Demo A001212 A004129 (MW, Wiki)
The postage stamp problem asks how long an initial interval of values can be formed from a fixed number of denominations using at most two stamps. This Demonstration compares the classical version, in which a denomination may be repeated (A001212), with the distinct-stamp version (A004129). Select a solution to see its marks, successive gaps and associated construction family. The two addends and their sums are plotted in increasing order of the sums. Proven optima are distinguished from unproven constructions, which establish lower bounds but may not be best possible.
The best solutions have patterns. These patterns have been divided into families. Since this is the Postage Stamp Problem, these families have been named after famous stamps. For example, the InvertedJenny family has a palindromic set of gaps: {1,2,1,2,4,3,2,6,8,8,8,8,8,8,6,2,3,4,2,1,2,1}.
Postage stamp problem A004129 (MW, Wiki)
The Treskilling recipe came in a computer search to extend known results.
A004129: bases for sums of two distinct marks
Notation: M = marks, R = range; a^b repeats gap a exactly b times;
(a,b)^r repeats the pair (a,b) exactly r times. Gaps begin at 0.
Family names are mnemonic labels, not established terminology.
​
PennyRed[t,r] = 1^(t-1),t-1,t^r
Cottonreel[t,r] = 1^2,2^t,1^2,2t+4,3,(2t+5,3)^r
BlueMauritius[t,r] = 1^t,t,(t+1)^r,t,1^t
SevenTail[r] = 1^2,2,1^2,4,3,7^r
NineTail[r] = 1^2,2^2,1,5,2,3,4,9^r
PennyBlack[t,r] = 1^(t-8),2,4,1,t-6,2,1^2,t-1,t^r
TreskillingYellow[t,r] = 1^(t-1),t-1,t^r,t-1,1^(t-1),tr+4(t-1),(t-1)^(t-1)
TreskillingShift[t,r,s] = 1^(t-1),t-1,t^r,t-1,1^(t-1),tr+4(t-1),(t-1)^s,t-2,t+1,t-2,(t-1)^(t-s-4)
Magenta[t,r] = 1^t,t^r,1^t,tr,(t+1)^(t-1),t(r+2)+1,(t+1)^(t-1)
TreskillingExcursion[t,k] = t-2,(t+1,t-3)^(k-1),t+1,t-2
TreskillingTails[t,m] = all concatenations of the block t-1 and blocks TreskillingExcursion[t,k] having exactly m gaps
Treskilling[t,r,u] = 1^(t-1),t-1,t^r,t-1,1^(t-1),tr+4(t-1),u

VERIFIED TRESKILLING CONSTRUCTIONS (LOWER BOUNDS; OPTIMALITY IS NOT CLAIMED)

Sources:

https://oeis.org/A004129
R. L. Graham and N. J. A. Sloane, On Additive Bases and Harmonious Graphs, SIAM J. Algebraic and Discrete Methods 1 (1980), 382-404.
J. Kohonen, An improved lower bound for finite additive 2-bases, J. Number Theory 174 (2017), 518-524; https://arxiv.org/abs/1606.04770
Postage stamp problem A001212 (MW, Wiki)
I also found stamp families for the original problem. Here’s the solution for the original Gardner problem.
The differences are palindromic. The larger solutions are almost all palindromic so far.
A001212: extremal additive 2-bases, written as gap families
Notation: N = denominations, R = range; a^b repeats gap a exactly b times;
(a,b)^r repeats the pair (a,b) exactly r times. Gaps begin at 0.
Family names are mnemonic labels, not established terminology.
​
BullHead[t,r] = 1^(t-1),t^r,1^(t-1)
RedRevenue[t,r] = 1^(t-1),t^r,1^(t-1),tr+2(t-1)+1,(t-1)^(t-1)
RedRevenue[r] = RedRevenue[2,r] = 1,2^r,1,2r+3,1
GronchiRosa[r] = 1,2,1,(5,2)^r,5,1,2,1
GrafZeppelin[r] = 1^3,4^r,2,1,2
WholeCountryRed[r] = 1^2,3,2,4^r,2,1,2
CIAinvert[r] = 1,2,1^2,3,6^r,3,1^2,2,1
InvertedJenny[r] = 1,2,1,2,4,3,2,6,8^r,6,2,3,4,2,1,2,1
BadenError[r] = 1,2,1,2,4,3,2,6,8^r,4,2,3,1^2,2^2
SicilianError[r] = 1,2,1,2,4,3,2,6,8^r,4,2,3,1,3,2,4
PanAmericaninvert[r] = 1,2,1^2,3^2,4,1,9^r,1,4,3^2,1^2,2,1
BlackSwan11[r] = 1,2,1,3,1^2,7,1,4,3,11^(r+2),3,4,1,7,1^2,3,1,2,1
Happy ending problem A052473 (MW, Wiki)
How many points in the general position force n points in convex position? Here are 8, 16 and 32 points with no pentagon, hexagon or heptagon.
Adding one more point forces a pentagon or hexagon. It’s unproven whether 33 points forces a heptagon.
Happy Ending: An Empty Hexagon in Every Set of 30 Points
Branko Grünbaum. Musings on an example of Danzer’s. European J. Combin., 29(8):1910–1918, 2008. https://arxiv.org/abs/1403.7939
A new (21_4) polycyclic configuration https://arxiv.org/abs/2309.12992.

Affine planes

In an affine plane:
1. Any two distinct points lie on a unique line.
2. Given any line and any point not on that line there is a unique line which contains the point and does not meet the given line.
3. There exist four points such that no three are collinear.

The Social Golfer Problem

Can 16 golfers play in quads over 5 days, each playing with all others exactly once? A resolvable 2-(16,4,1) design, equivalently the affine plane AG(2,4).
Can 15 schoolgirls go to school in triplets over 7 days, each walking with all others exactly once? Resolvable Steiner triple system STS(15).
In 1850, Reverend Thomas Kirkman sent a related query to the readers of a popular math magazine, Lady’s and Gentleman’s Diary: Fifteen young ladies in a school walk out three abreast for seven days in succession: it is required to arrange them daily, so that no two will walk twice abreast. Arthur Cayley and Jakob Steiner solved the problem. For groups of three, solutions are called either a resolvable Steiner triple system (RSTS) or a Kirkman triple system (KTS).
Can 25 golfers play in groups of five for six days, each playing with all others exactly once? Affine plane AG(2,5).
A group consists of 32 golfers who want to play in groups of four for several days. Can they play for ten days, with no pair of golfers in the same group twice? (The reader may want to skip the next three paragraphs.)

Self-Dual Configurations

In barycentrics, a point is on a line if point.line = 0. {a,b,c}.{x,y,z} = ax+by+cz. Here’s a particular set of points AND lines so that every point is on three lines, and vice versa. Every barycentric point is also a barycentric line.
A smaller self-dual set with less symmetry.
It’s also possible to find 24 points and lines so that 4 lines are on each point and 4 points are on each line ... and that the point definitions are the same as the line definitions.

A moment of Venn

Order 5 Venn diagram.
With overlapping polygons.

Introducing SWATCH

Let’s overlap those polygons and get some named colors out of it.
ResourceFunction["Swatch”] has 6,414 named colors comprising 2,861 distinct colors.
Here’s a Voronoi diagram of all the distinct colors:
I mentioned in my Geology talk that all colors of geological eras gets their own official color.
Since I wanted to have all specific, non-proprietary colors that had specific names, I added them.
And an image using only that palette.

The Battle of the Dyes

The 1856 discovery of mauvine by teenager William Henry Perkin started the battle of the dyes. He was trying to cure malaria.
One of the first subsequent dyes was Fuchsine, but people thought that name was terrible, so the dye was renamed after the Battle of Magenta.
Chemist Heinrich Caro joined in with the creation of induline, eosin and methylene blue.
Paul Ehrlich found the last dye ... cured malaria, making meth blue the first synthetic drug used in medicine.
With a similar technique, Paul cured syphilis.
Gerolamo Induno’s 1861 Battle of Magenta with a magenta filter.

AG(4,3), AG(6,2)

AG(3,4) has 336 valid four-card groups, compared with 10,416 quads under the AG(6,2) EvenQuads rule.
A set of 4 makes a quad if the placed digits are all-the-same or all-different. In AG(6,2), a pairs of pairs is allowed.
In AG(3,4), sort one all-different placement 0123. The other all-different placements must be even permutations.
Selecting all the AG(3,4) lines
We can set up four of them
This set has four solutions. Seems like a tricky game.
Three cards from the binary set gives projective geometry PG(5,2). Pick cards so that each position has an even number of black squares.

Graceful Permutations A006967

All possible gaps in a permutation.
The graceful permutations of order 9:
In terms of gaps, the first representatives

An extremal tesseract

Minimize the crossings.
Minimize the lines.
Minimize the number of ratios between squares.

Extremal Combinatorics

Nonaveraging set A003002

nonaveraging = {1, 3, 4, 8, 9, 11, 20, 22, 23, 27, 28, 30};
Twelve elements of Range[30], with no element the average of two others. Twelve is maximal.

Leech yardstick A004137

leechYardstick = {0, 1, 3, 6, 13, 20, 27, 31, 35, 36};
A ten-mark sparse yardstick measuring every integral distance from 1 through 36; unique up to reflection.

Singer difference set A333852

singer = {0, 1, 3, 8, 12, 18};
Modulo 31, its 30 ordered nonzero differences give every residue from 1 through 30 exactly once.

Optimal Golomb ruler A079426

golombRuler = {0, 1, 6, 10, 23, 26, 34, 41, 53, 55};
Its 45 positive pairwise differences are distinct, and no ten-mark Golomb ruler is shorter than 55.

Restricted postage-stamp basis A006638

postageBasis = {0, 1, 2, 3, 7, 11, 15, 17, 20, 21, 22};
Every integer from 0 through 44 is a sum of two members; 44 is the maximum restricted range for ten nonzero denominations.

Graceful permutation A006967

gracefulPermutation = {1, 10, 2, 9, 3, 8, 4, 7, 5, 6};
The consecutive absolute differences are exactly Range[9].

Costas permutation A008404

costasPermutation = {2, 4, 8, 5, 10, 9, 7, 3, 6, 1};
All displacement vectors between pairs of permutation points are distinct.

Maximum Sperner antichain A001405

spernerAntichain = {3, 5, 6, 9, 10, 12, 17, 18, 20, 24};
Read as five-bit masks, these are all ten two-element subsets of a five-set. None contains another, and ten is maximal.

Maximum cap in GF(3)^3 A090245 (Relating to the Game of SET)

capSet = {1, 2, 4, 9, 20, 45, 112};
Read as three-digit base-3 vectors, no three are collinear. Nine is maximal.

Perfect binary Hamming code A000983

hammingCode = {0, 7, 25, 30, 42, 45, 51, 52, 75, 76, 82, 85, 97, 102, 120, 127};
Read as seven-bit words, the minimum Hamming distance is 3 and the radius-one balls partition all 128 words.

CITE THIS NOTEBOOK

Mathematical Games: colors and combinatorics​
by Ed Pegg​
Wolfram Community, STAFF PICKS, August 28, 2026
​https://community.wolfram.com/groups/-/m/t/3788619