Card 54, where are you?
Jud McCranie
jud.mccranie at mindspring.com
Tue Nov 17 00:37:14 CET 1998
At 05:31 AM 11/17/98 +0700, Warut Roonguthai wrote:
>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?
In Pascal on a 300 MHz Pentium II, it takes about 9.6 seconds.
What is the smallest card number for which this is not known?
+-----------------------------------------------------------+
| Jud McCranie jud.mccranie at mindspring.com or @camcat.com |
| |
| "We should regard the digital computer system as an |
| instrument to assist the number theorist in investigating |
| the properties of his universe - the natural numbers." |
| -- D. H. Lehmer, 1974 (paraphrased) |
+-----------------------------------------------------------+
More information about the SeqFan
mailing list