Card 54, where are you?

Warut Roonguthai warut at ksc9.th.com
Mon Nov 16 23:31:56 CET 1998


I use the UBASIC code below to find how many shuffles are required for
card n to reach the top (for the first time):

10   input N
20   clr time
30   I=(N-1)\2
40   while N>1
50    inc I
60    if N>I then N=2*(N-I)-1 else N+=N
70   wend
80   print I;time
90   goto 10

It took about 20 minutes on a 266-MHz Pentium II to find that card 54
reached the top at 252992198th shuffle.  If the code was written in
assembly language, the computation would take only a few seconds since
each shuffle would take only a few clock cycles.  Anyone want to try?






More information about the SeqFan mailing list