cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A035493 Order in which new cards appear on top of deck in Guy's shuffling problem A035485.

This page as a plain text file.
%I A035493 #22 Feb 16 2025 08:32:37
%S A035493 1,2,3,6,5,9,4,16,10,12,14,23,18,20,17,27,30,33,38,37,32,11,19,53,25,
%T A035493 21,34,8,50,48,46,47,84,52,31,49,51,91,61,42,79,29,26,115,70,93,109,
%U A035493 124,97,134,111,7,129,131,157,107,123,117,96,94,72,178,86,35,121
%N A035493 Order in which new cards appear on top of deck in Guy's shuffling problem A035485.
%D A035493 D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56.
%D A035493 D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998.
%H A035493 Lars Blomberg, <a href="/A035493/b035493.txt">Table of n, a(n) for n = 1..6679</a>
%H A035493 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectShuffle.html">Perfect Shuffle.</a>
%o A035493 (Python)
%o A035493 from itertools import count, islice
%o A035493 def agen(): # generator of terms
%o A035493     deck = []; tops = {1}; yield 1
%o A035493     for n in count(1):
%o A035493         deck += [2*n-1, 2*n]
%o A035493         first, next = deck[:n], deck[n:2*n]
%o A035493         deck[0:2*n:2], deck[1:2*n:2] = next, first
%o A035493         if deck[0] not in tops: tops.add(deck[0]); yield deck[0]
%o A035493 print(list(islice(agen(), 65))) # _Michael S. Branicky_, Aug 11 2022
%Y A035493 Cf. A035485, A035490, A035491, A035492, A035494, A035500.
%K A035493 nonn
%O A035493 1,2
%A A035493 _N. J. A. Sloane_, _Wouter Meeussen_
%E A035493 Extended (and corrected) by _Jud McCranie_