Limerick primes

by John on March 8, 2011

The other day, Futility Closet posted this observation:

10102323454577 is the smallest 14-digit prime number that follows the rhyme scheme of a Shakespearean sonnet (ababcdcdefefgg).

I posted this on AlgebraFact and got a lot of responses. One was from Matt Parker who replied that 11551 was the smallest prime with a limerick rhyme scheme.

So how many limerick primes are there? Well, there aren’t many candidates. A limerick prime has to have the form AABBA where A is an odd digit and B is any digit other than A. So for each of five choices of A, there are nine possible B’s. Here’s a Mathematica program to do a brute force search for limerick primes.

For[ j = 0, j < 5, j++,
    For[ k = 0, k < 10, k++,
        x = (2 j + 1)*11001 + 110 k;
        If[ PrimeQ[x], Print[x] ]]]

It turns out there are eight limerick primes:

  • 11551
  • 33113
  • 33223
  • 33773
  • 77447
  • 77557
  • 99119
  • 99559

See the next post for Mathematica code to list all sonnet primes.

Related posts:

Divisibility by 7
Odd perfect numbers
Twin prime conjecture and the Pentium division bug

{ 7 comments… read them below or add one }

1

Mike 03.08.11 at 13:53

Incidentally, 99559 are the number of syllables per line in a limerick.

2

John V. 03.08.11 at 15:27

Thats really cool and it takes me back to my youth …

One of my first forays into numerical computing was an implementation of the Sieve of Eratosthenes in graphics memory (for space) to ennumerate primes. I noticed that 16661 was prime and then limited the output to palindromic primes. I happened to notice that all of the palindromic primes except 11 had an odd number of digits. That inspired my first mathematical proof — that 11 is the only palindromic prime with an even number of digits.

3

nunya 03.09.11 at 11:21

What if you consider 2 digits for a and b like AABBA = 13 13 12 12 13?

4

nickL 03.09.11 at 11:32

Here are additional limerick primes for A and B < 20,

7710107, 7713137, 7719197, 9913139, 9916169, 9919199, 1111202011,13134413, 13138813, 17172217, 17177717, 1717202017, 19191119, 19192219, 19194419, 1919111119, 1919161619, 1919171719.

5

EastwoodDC 03.10.11 at 10:40

Wishing I had time today to compose an appropriate limerick in response. :-)

6

Andrew 06.18.11 at 13:49

Two quintillion, seventy-seven
Quadrillion, three hundred eleven
Trillion, one billion,
Twenty-four million,
One thousand two hundred and seven.

7

John 06.18.11 at 14:19

Andrew’s prime above is 2077311001024001207 for those who, like me, might need to look up the meaning of quintillion or quadrillion.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>