Langford's problem asks for an arrangement of two copies of the integers 1, ..., , for a positive integer
, with exactly
entries between the two occurrences of
for each
, ...,
. For example, the unique (modulo reversal)
solution is 231213, and the unique (again modulo reversal)
solution is 23421314.
Davies (1959) showed that solutions to Langford's problem exist iff (cf. Assarpour et al.
2017), so the next solutions occur for
. There are 26 of these, as
exhibited by Lloyd (1971). Listed by increasing
and then in lexicographic
order, with each solution represented by the smaller of it and its reversal,
the first few Langford sequences are 231213, 23421314, 14156742352637, 14167345236275,
15146735423627, ... (OEIS A050998).
The numbers of solutions for , 4, 5, ... (modulo reversal
of the entries) are 1, 1, 0, 0, 26, 150, 0, 0, 17792, 108144, ... (OEIS A014552).
No formula is known for the number of solutions of a
given order
, but Assarpour et al. (2017) computed their
counts up to
, making
the smallest unknown case (since there are no Langford
sequences of order 29 or 30).
A generalized Langford sequence of order and defect
uses two copies of each integer
. Number positions from 1 through
. The two copies of
occupy positions whose difference is
. Thus the classical problem corresponds to
after increasing each label by 1, and
gives a Skolem sequence.
For example, the classical solution 231213 becomes
at defect 2.
For positive
and
, such a sequence exists exactly when
and the following congruences
hold:
or
if
is odd, and
or
if
is even. Simpson (1983) completed the proof of sufficiency begun by Bermond et
al. (1978).
If the copies of
are at positions
, the triples
form a regular
perfect
system of difference sets. The differences within the triples include
from
, and the pairs of positions
supply
as differences from 0 (Bermond et al. 1978, Rogers 1986).