Problems & Puzzles: Puzzles

Puzzle 144.  The Langford Prime Numbers

I will define a Langford Number LN (*) the following way:

For every digit "D" in LN always exists another digit "D" - rightward or leftward - after D digits, none of which is "D".


  • 2002
  • 131003
  • 2312132

I will impose two additional restrictions:

no more than two consecutive zeros are allowed (thus 2002002 is permitted but not 30003) and no leading zeros are allowed

According to my search 723121327 is the first LN prime (nicely the first LN prime is a palprime!)


1. Find the next nine LN primes
2. Find a Titanic
LN prime
3. Do you devise a general strategy to obtain a LN (not necessarily prime) with length>9 and the length being odd ?

*Honoring the Scottish mathematician C. Dudley Langford author of the now well-known 'Langford's problem' (see the complete story, versions and status in the John E. Miller's site). But warning! the definition given in this puzzle 144 for the Langford Numbers LN accepts more solutions than the corresponding to the numerical version of the original problem.


Other prime LN by CR: 1712002007, 1712312137, 2412134003, 2612112161, 2742121427, 2742300437, 3004300141, 


Giuliano Daddario has found (19/9/01) a lot of solutions posing different sets of conditions defining the LN s. I show below only a part of these results keeping the definition here given:

" if 20022002 is not acceptable, but 2002002 is then:

723121327, 1712002007, 2412134003, 2742300437, 3004300141, 5001315131, 7200200171, 31713121327, 36723121627, 45723425327, 51712152007, 52712151007, 52712152007, 56714151647, 67340036473, 72312131713, 82312130083, 83002312181, 141753400357, 161514136543, 171450034753, 191214200249, ..."


Jim Fougeron devised a procedure to get LN numbers of any length: just to concatenate small previously known/generated LN numbers.

Then to obtain a Titanic one he basically concatenated "at hand" several of these up to a convenient (titanic) length; to this titanic constant number he appended many odd LN numbers -one at a time - until he got a PRP.

This is one Titanic LN prime obtained and proved by Jim:


This has been proven with Primo in 2:45 (I had to backtrack one time after a step took over an hour)

But the first concatenations was made between between in a special way, better explained in Jim's own words:

There are two types of LN numbers. Type 1 is simply a "pair" of numbers which have 'D' numbers between them. A Type 2 is a run of more than 2 number which meet this pattern. A couple of examples may make this a little more clear.

Type 1: 121623800361417814100171

LN hits per each digit:

1 reversed
2 reversed

Extending this to all remaining digits, they ALL only match a single 'D' forward or a single 'D' backward.

Type 2: 312132412134003 (but contains many Type 1's)

LN hits per each digit:

3...3...2 (Type 1)
1.1.2 (Type 1)
2..2..2..4 (Type 2, more than a single run, this is also allows the "odd"
length of this number
1 reversed
3 reversed
middle 2 value
4....4... end of number
All other values are of "Type 1"

As for the prime sent, I simply concatenated found LN's, but I selected the LN's to concatenate so that there would be a Type 2 with each concatenation.

Here is an example:

121421914512132593, 1215260025326131, 1216200352632151

These are all LN's. They can easily be concatenated to create the longer LN

1214219145121325 93+121 5260025326 131+121 6200352632151

A plus shows where the numbers were joined, and the space shows where the "Type 2" merge also happens. Note the second concatenation is not as nice as the first, since on the second one, it put 1.11.1 which is not a "pleasant" pattern (although it is 100% legal). To build the titanic LN number I simply edited by hand the LN's which I had previously generated (about 1800 of length 8 to about 30). I then used this number and appended other singleton LN's until a PRP arrived.


As you can see Jim has a code to generate LN numbers as large as 30 digits. In a previous email he recognizes that his approach for this step is an "at random" construction of these numbers.

Now Jim is working in that very step trying to avoid the randomness construction. I doing so, if he has success he will respond the question 3) of this puzzle.


Following the idea of Jim about to concatenate LN numbers, I (C. Rivera) have gotten a palindrome and titanic LN prime (currently only SPSP) number:

121 (720020027121)135



Records   |  Conjectures  |  Problems  |  Puzzles