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.

A035492 Position of card 1 after n-th shuffle in Guy's shuffling problem (A035485).

This page as a plain text file.
%I A035492 #24 Feb 16 2025 08:32:37
%S A035492 1,2,4,1,2,4,8,1,2,4,8,16,7,14,28,25,17,34,31,23,5,10,20,40,31,11,22,
%T A035492 44,31,3,6,12,24,48,27,54,35,70,63,47,13,26,52,17,34,68,43,86,75,51,1,
%U A035492 2,4,8,16,32,64,13,26,52,104,85,45,90,51
%N A035492 Position of card 1 after n-th shuffle in Guy's shuffling problem (A035485).
%D A035492 D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56.
%D A035492 D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998.
%H A035492 Lars Blomberg, <a href="/A035492/b035492.txt">Table of n, a(n) for n = 0..9999</a>
%H A035492 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectShuffle.html">Perfect Shuffle.</a>
%t A035492 Transpose[Position[NestList[riguy, {}, 64], 1]][[2]] (* See A035490. *)
%o A035492 (Python)
%o A035492 from itertools import count, islice
%o A035492 def agen(): # generator of terms
%o A035492     deck = []; yield 1
%o A035492     for n in count(1):
%o A035492         deck += [2*n-1, 2*n]
%o A035492         first, next = deck[:n], deck[n:2*n]
%o A035492         deck[0:2*n:2], deck[1:2*n:2] = next, first
%o A035492         yield deck.index(1) + 1
%o A035492 print(list(islice(agen(), 65))) # _Michael S. Branicky_, Aug 11 2022
%Y A035492 Cf. A035485, A035490, A035491, A035493, A035494.
%K A035492 nonn
%O A035492 0,2
%A A035492 _Wouter Meeussen_