Prime squiggle

I have a computer program I once wrote which counts 2, 3, 4, 5, … all the way up to a specified termination point, and draws a squiggly line according to a simple mathematical rule.

Every time the counter passes a prime number, the line turns a 90 degree corner. Every time it passes a composite number, the line is extended one pixel forward. It goes up on four (the first composite), left on six (having passed the prime five), down on eight, nine and ten (having passed the prime seven), right on twelve, and so on.

[Update June 2007: I have made the Java program available for download here. The "PrimeFinderMessGUI" Java application will display instructions on standard output.]

Here is a picture of what the line looks like after the program has counted to 100,000. Notice that up until about 11,000 (and there are over a thousand primes before 11,003) the overall trend is very distinctly vertical, rather like rising smoke. This means that every fourth interval between primes in that range tends to be larger than the rest, which is surprising. But wait! You ain’t seen nothing yet.

(more…)

Published in: on 18 Nov 06 at 10:08 pm Comments (0)

The fragility of pingpong balls

Many years ago, a thread on alt.fan.pratchett lead to an essay-writing challenge. Main participants included Richard Bos, Chris Horry and myself. It had been mentioned that in some schools, there is a punishment which consists of writing an essay on the inside of a pingpong ball. Richard took up the challenge, and wrote such an essay for fun, which Chris published on his website.

This reminded me of an idea I’d had some time before, which was this. One person writes an essay on an obscure topic. The next person writes an essay on one particular sentence from the first person’s essay, this sentence being chosen by some agreed algorithm (e.g. second sentence from second paragraph, or something). And so on. The essays will inevitably be so obscure, pointless and rambling that they can only be thought of as parodies of obscure, pointless, rambling essays - providing much amusement to all.

Anyway, one sentence in Richard’s essay on the inside of a ping-pong ball was this:

Ping pong balls are fragile, and it is not necessary for them to show their insides any more often than they already do.

So I wrote an essay evaluating that claim. This essay was rushed, and I make no apologies for its lack of polish; I was, after all, just having fun. When I had written my essay, and it was published on Chris’s website, Richard and I challenged Chris to write an essay analysing the following sentence from it.

[on whether ice cream is hot] - it certainly contains some heat, therefore on the Kelvin scale it probably is.

Sadly, this essay was never written (the reader is welcome to take it on). But here’s mine.

(more…)

Published in: on at 12:03 pm Comments (0)