[seqfan] Re: Seqfan Digest, Vol 36, Issue 1
Peter Lawrence
peterl95124 at sbcglobal.net
Tue Sep 6 20:44:24 CEST 2011
Neil,
sequence of all possible lists over the letters "0", "1", "2",
such that within a list no two adjacent letters are the same,
firstly sorted by length of list,
secondly lists of same length sorted lexicographically.
or recursively
to each list of length N create two lists of length N+1
by appending the two letters that are different from the last letter
of the first list,
keep all the lists sorted as in the previous description.
-Peter Lawrence.
On Sep 4, 2011, at 2:19 AM, seqfan-request at list.seqfan.eu wrote:
> ------------------------------
>
> Message: 15
> Date: Sun, 4 Sep 2011 05:19:37 -0400
> From: "N. J. A. Sloane" <njas at research.att.com>
> To: seqfan at seqfan.eu
> Cc: njas at research.att.com
> Subject: [seqfan] help needed with former sequence A138036
> Message-ID: <201109040919.p849JbB0025021 at prim.research.att.com>
> Content-Type: text/plain; charset=us-ascii
>
> Dear Seqfans, I admit I don't speak Mathematica.
> Here is the definition of the former sequence A138036
> (now deleted from the OEIS, but you can read the History):
>
> Clear[a]; a = With[{n = 8, k = 3}, NestList[DeleteCases[Flatten[Map
> [Table[Append[ #, i - 1], {i, k}] &, # ], 1], {___, u__, v__} /;
> Sort[{u}] == Sort[{v}]] &, {{}}, n]]; Flatten[a]
>
> which apparently produces
>
> {{}},
> {{0}, {1}, {2}},
> {{0, 1}, {0, 2}, {1, 0}, {1, 2}, {2, 0}, {2, 1}},
> {{0, 1, 0}, {0, 1, 2}, {0, 2, 0}, {0, 2, 1}, {1, 0, 1}, {1, 0, 2},
> {1, 2, 0}, {1, 2, 1}, {2, 0, 1}, {2, 0, 2}, {2, 1, 0}, {2, 1, 2}},
> {{0, 1,0, 2}, {0, 1, 2, 0}, {0, 1, 2, 1}, {0, 2, 0, 1}, {0, 2, 1,
> 0}, {0, 2, 1, 2}, {1, 0, 1, 2}, {1, 0, 2, 0}, {1, 0, 2, 1}, {1, 2,
> 0, 1}, {1, 2, 0, 2}, {1, 2, 1, 0}, {2, 0, 1, 0}, {2, 0, 1, 2}, {2,
> 0, 2, 1}, {2, 1, 0, 1}, {2, 1, 0, 2}, {2, 1, 2, 0}},
> {{0, 1, 0, 2, 0}, {0, 1, 0, 2, 1}, {0, 1, 2, 0, 1}, {0, 1, 2, 0,
> 2}, {0, 1, 2, 1, 0}, {0, 2, 0,1, 0}, {0, 2, 0, 1, 2}, {0, 2, 1, 0,
> 1}, {0, 2, 1, 0,2}, {0, 2, 1, 2, 0}, {1, 0,1, 2, 0}, {1, 0, 1, 2,
> 1}, {1, 0, 2, 0, 1}, {1, 0, 2, 1, 0}, {1, 0, 2, 1, 2}, {1, 2, 0, 1,
> 0}, {1, 2, 0, 1, 2}, {1, 2, 0, 2, 1}, {1, 2, 1, 0, 1}, {1, 2, 1, 0,
> 2}, {2, 0,1, 0, 2}, {2, 0, 1, 2, 0}, {2, 0, 1, 2, 1}, {2, 0, 2,1,
> 0}, {2, 0, 2, 1, 2}, {2,1, 0, 1, 2}, {2, 1, 0, 2, 0}, {2, 1, 0, 2,
> 1}, {2, 1, 2, 0, 1}, {2, 1, 2, 0, 2}},
> ...
>
More information about the SeqFan
mailing list