Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A000376
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A000376 Topswops (2): shuffle n cards labeled 1..n. If top card is m, reverse order of top m cards. Repeat until 1 gets to top, then stop. Suppose the whole deck is now sorted (if not, discard this case). a(n) is the maximal number of steps before 1 got to the top. +0
2
1, 2, 4, 7, 10, 16, 22, 30, 38, 51, 63, 80, 101, 112, 130, 159 (list; graph; listen)
OFFSET

2,2

COMMENT

See also A000375, which is the main entry for this problem.

Comments from Joshua Zucker (joshua.zucker(AT)gmail.com), Jan 24 2007: (Start)

For some n, there are some longest chains which end up sorted and some which don't, like n = 6, with the following four chains that end sorted and one that does not:

The examples below use 0 through n-1 instead of 1 through n.

((#(4 5 3 0 2 1) #(2 0 3 5 4 1) #(3 0 2 5 4 1) #(5 2 0 3 4 1) #(1 4 3 0 2 5) #(4 1 3 0 2 5) #(2 0 3 1 4 5) #(3 0 2 1 4 5) #(1 2 0 3 4 5) #(2 1 0 3 4 5) #(0 1 2 3 4 5))

(#(3 4 5 1 0 2) #(1 5 4 3 0 2) #(5 1 4 3 0 2) #(2 0 3 4 1 5) #(3 0 2 4 1 5) #(4 2 0 3 1 5) #(1 3 0 2 4 5) #(3 1 0 2 4 5) #(2 0 1 3 4 5) #(1 0 2 3 4 5) #(0 1 2 3 4 5))

(#(3 0 4 1 5 2) #(1 4 0 3 5 2) #(4 1 0 3 5 2) #(5 3 0 1 4 2) #(2 4 1 0 3 5) #(1 4 2 0 3 5) #(4 1 2 0 3 5) #(3 0 2 1 4 5) #(1 2 0 3 4 5) #(2 1 0 3 4 5) #(0 1 2 3 4 5))

(#(2 5 4 0 3 1) #(4 5 2 0 3 1) #(3 0 2 5 4 1) #(5 2 0 3 4 1) #(1 4 3 0 2 5) #(4 1 3 0 2 5) #(2 0 3 1 4 5) #(3 0 2 1 4 5) #(1 2 0 3 4 5) #(2 1 0 3 4 5) #(0 1 2 3 4 5)))

(#(3 0 5 4 1 2) #(4 5 0 3 1 2) #(1 3 0 5 4 2) #(3 1 0 5 4 2) #(5 0 1 3 4 2) #(2 4 3 1 0 5) #(3 4 2 1 0 5) #(1 2 4 3 0 5) #(2 1 4 3 0 5) #(4 1 2 3 0 5) #(0 3 2 1 4 5))

And for some n, e.g. n=12, none of the longest chains end up sorted (and hence A000375 and A000376 are different). I did an exhaustive search with n = 12 working backwards from sorted and found 63 as the longest chain beginning with one of these four:

#(9 10 6 0 2 7 1 8 11 5 3 4)

#(9 10 6 0 1 2 7 8 11 5 3 4)

#(7 8 11 5 0 6 10 9 2 1 3 4)

#(5 0 1 7 10 3 11 8 9 6 2 4)

But 65 is attainable if you don't assume it ends up sorted. (End)

REFERENCES

D. E. Knuth, TAOCP, Section 7.2.1.2, Problems 107-109.

CROSSREFS

Cf. A000375.

Sequence in context: A049640 A024668 A160790 this_sequence A000375 A131752 A062365

Adjacent sequences: A000373 A000374 A000375 this_sequence A000377 A000378 A000379

KEYWORD

nonn,hard,nice

AUTHOR

Bill Blewett [ billble(AT)microsoft.com ], Mike Toepke [ mtoepke(AT)microsoft.com ]

EXTENSIONS

Two more terms from James Kilfiger (mapdn(AT)csv.warwick.ac.uk) 7/97. 130 and 159 from William Rex Marshall (w.r.marshall(AT)actrix.co.nz), Mar 28 2001.

Definition clarified by Franklin T. Adams-Watters, Jan 24 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 1 19:22 EST 2009. Contains 167811 sequences.


AT&T Labs Research