Stage Business

The goal of the Shakespeare programming language is to create code that reads like a Shakespearean play: Variables are “characters” that interact through dialogue, constants are represented by nouns and adjectives, and if/then statements are phrased as questions. (Insulting Macbeth assigns him a negative value.) Act and scene numbers serve as GOTO labels, and characters can tell one another to “remember” or “recall” values. The phrases “Open your heart” and “Speak your mind” output a variable’s numerical value and the corresponding ASCII character, respectively.

This program prints the phrase HELLO WORLD:

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.

                   Act I: Hamlet's insults and flattery.
                   Scene I: The insulting of Romeo.
[Enter Hamlet and Romeo]
You lying stupid fatherless big smelly half-witted coward! You are as
stupid as the difference between a handsome rich brave hero and thyself!
Speak your mind!
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Speak your mind!
[Exit Romeo]
                   Scene II: The praising of Juliet.
[Enter Juliet]
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!
[Exit Juliet]
                   Scene III: The praising of Ophelia.
[Enter Ophelia]
Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!
Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!
[Exeunt Ophelia and Hamlet]

                   Act II: Behind Hamlet's back.
                   Scene I: Romeo and Juliet's conversation.
[Enter Romeo and Juliet]
Speak your mind. You are as worried as the sum of yourself and the
difference between my small smooth hamster and my nose. Speak your
Speak YOUR mind! You are as bad as Hamlet! You are as small as the
difference between the square of the difference between my little pony
and your big hairy hound and the cube of your sorry little
codpiece. Speak your mind!
[Exit Romeo]
                   Scene II: Juliet and Ophelia's conversation.
[Enter Ophelia]
Thou art as good as the quotient between Romeo and the sum of a small
furry animal and a leech. Speak your mind!
Thou art as disgusting as the quotient between Romeo and twice the
difference between a mistletoe and an oozing infected blister! Speak
your mind!

Because it’s written as a play, a program can be performed by human actors, but the drama lacks a certain narrative drive:

See Output.

Sociable Numbers

The sum of the proper divisors of 14316 is 19116.
The sum of the proper divisors of 19116 is 31704.
The sum of the proper divisors of 31704 is 47616.
The sum of the proper divisors of 47616 is 83328.
The sum of the proper divisors of 83328 is 177792.
The sum of the proper divisors of 177792 is 295488.
The sum of the proper divisors of 295488 is 629072.
The sum of the proper divisors of 629072 is 589786.
The sum of the proper divisors of 589786 is 294896.
The sum of the proper divisors of 294896 is 358336.
The sum of the proper divisors of 358336 is 418904.
The sum of the proper divisors of 418904 is 366556.
The sum of the proper divisors of 366556 is 274924.
The sum of the proper divisors of 274924 is 275444.
The sum of the proper divisors of 275444 is 243760.
The sum of the proper divisors of 243760 is 376736.
The sum of the proper divisors of 376736 is 381028.
The sum of the proper divisors of 381028 is 285778.
The sum of the proper divisors of 285778 is 152990.
The sum of the proper divisors of 152990 is 122410.
The sum of the proper divisors of 122410 is 97946.
The sum of the proper divisors of 97946 is 48976.
The sum of the proper divisors of 48976 is 45946.
The sum of the proper divisors of 45946 is 22976.
The sum of the proper divisors of 22976 is 22744.
The sum of the proper divisors of 22744 is 19916.
The sum of the proper divisors of 19916 is 17716.
The sum of the proper divisors of 17716 is 14316 again.

Rich Earth
Image: Wikimedia Commons

Why do the elements ytterbium, yttrium, terbium, and erbium have similar names?

Because all four of them were first discovered in ore from the same mine near the Swedish village of Ytterby.

Holmium, thulium, and gadolinium were discovered at the same source — leading some to call Ytterby the Galápagos of the periodic table.


Create a strip of 19 triangles like the one above (printable version here) and fold the left portion back successively at each of the northeast-pointing lines to produce a spiral:
Image: Wikimedia Commons

Fold this spiral backward along line ab:
Image: Wikimedia Commons

Then fold the resulting figure backward at cd. You should be left with one blank triangular tab that can be folded backward and pasted to another blank panel on the opposite side. The resulting hexagon should have six 1s on one side and six 2s on the other.

With some adroit pinching this hexagon produces some marvelous effects. Fold down two adjacent triangles so that they meet, and then press in the opposite corner to join them. Now the top of the figure can be prised open and folded down to produce a new hexagon — this one with 1s on one face and a surprising blank on the second. What has become of the 2s?

Exploring the properties of this “hexahexaflexagon” offers an intuitive lesson in geometric group theory:

When Martin Gardner wrote about these bemusing creatures in his first column for Scientific American in 1956, he received two letters. The first was from Neil Uptegrove of Allen B. Du Mont Laboratories in Clifton, N.J.:


I was quite taken with the article entitled ‘Flexagons’ in your December issue. It took us only six or seven hours to paste the hexahexaflexagon together in the proper configuration. Since then it has been a source of continuing wonder.

But we have a problem. This morning one of our fellows was sitting flexing the hexahexaflexagon idly when the tip of his necktie became caught in one of the folds. With each successive flex, more of his tie vanished into the flexagon. With the sixth flexing he disappeared entirely.

We have been flexing the thing madly, and can find no trace of him, but we have located a sixteenth configuration of the hexahexaflexagon.

Here is our question: Does his widow draw workmen’s compensation for the duration of his absence, or can we have him declared legally dead immediately? We await your advice.

The second was from Robert M. Hill of The Royal College of Science and Technology in Glasgow, Scotland:


The letter in the March issue of your magazine complaining of the disappearance of a fellow from the Allen B. Du Mont Laboratories ‘down’ a hexahexaflexagon, has solved a mystery for us.

One day, while idly flexing our latest hexahexaflexagon, we were confounded to find that it was producing a strip of multicolored material. Further flexing of the hexahexaflexagon finally disgorged a gum-chewing stranger.

Unfortunately he was in a weak state and, owing to an apparent loss of memory, unable to give any account of how he came to be with us. His health has now been restored on our national diet of porridge, haggis and whisky, and he has become quite a pet around the department, answering to the name of Eccles.

Our problem is, should we now return him and, if so, by what method? Unfortunately Eccles now cringes at the very sight of a hexahexaflexagon and absolutely refuses to ‘flex.’

Saving Face
Image: Wikimedia Commons

“The Joker,” a picture-preserving geomagic square by Lee Sallows. The 16 pieces can be assembled in varying groups of 4 to produce the same picture in 16 different ways, without rotation or reflection.

The outline need not be a joker — it can take almost any shape.


After seeing a manuscript of On the Origin of Species in April 1859, the Rev. Whitwell Elwin suggested that Darwin write about pigeons instead.

“This appears to me an admirable suggestion,” he wrote. “Everybody is interested in pigeons.”

Magic Variations

frolov pentagon

From Edward Falkener’s Games Ancient and Oriental and How to Play Them (1892), a magic pentagon. “It will be observed that the five sides of each pentagon are all equal, and that the five diameters, from one angle to the centre of the opposite side, are each 459, which is nine times the central number 51, which is also the mean number, the series being 1-101. And, further, that the inner pentagon is 510, or 10 times the mean number; the next pentagon 1,020, or 20 times the mean; the next 1,530, or 30 times the mean; and the outside pentagon 2,040, or 40 times the mean.” Evidently this was devised by Mikhail Frolov for Les carrés magiques (1886). (08/25/2015 Reader MJ has perfected this further, making each side of the outermost ring total 459, the same as the diagonals.)

From the Gentleman’s Magazine, October 1768, a “magic circle of circles” by Benjamin Franklin:

The numbers run from 12 to 75. Each ring and each radius, added to the central number 12, gives 360, the number of degrees in a circle. The dashed lines define four additional sets of circles, with centers at A, B, C, and D, each with five rings; each ring, when added to 12, also gives the total 360. (The 12 is added arbitrarily to bring the total to 360; remove it and the whole arrangement remains magic.)

From the inimitable R.V. Heath:

heath cube

This 8×8 magic square can be cut into four smaller magic squares. When these four are stacked in the order indicated they produce a pandiagonal magic cube, each of whose rows, columns, and diagonals produces the total 130. Also: “The original eighth-order magic square has the additional property that if either set of alternate rows and either set of alternate columns be deleted — and this can be done in four ways — the remaining 16 numbers form a fourth-order magic square of magic constant 130.” (From Howard Whitley Eves, Mathematical Circles Squared, 1972.)

(Thanks, Ray.)

Still LifeÉcorché_cavalier_Fragonard_Alfort_1_edit1.jpg

French anatomist Honoré Fragonard (1732-1799) blurred the line between science and art by arranging human and animal bodies in fanciful poses. By replacing the eyeballs with glass replicas and injecting a distorting resin into the facial blood vessels, he achieved some remarkably expressive effects — his Fetus Dancing the Jig is best left to the imagination.

Florence’s Museum of Zoology and Natural History preserves a collection of wax models that were used in teaching medicine in the 18th century (below). Modelers might refer to 200 corpses in preparing a single wax figure. “If we succeeded in reproducing in wax all the marvels of our animal machine,” wrote director Felice Fontana, “we would no longer need to conduct dissections, and students, physicians, surgeons and artists would be able to find their desired models in a permanent, odor-free and incorruptible state.” Goethe praised artificial anatomy as “a worthy surrogate that, ideally, substitutes reality by giving it a hand.”
Image: Wikimedia Commons

(From Roberta Panzanelli, ed., Ephemeral Bodies, 2008.)