A238373 The number of "topped inward" shuffles to reorder a stack of n cards to its original order.
3, 4, 2, 4, 7, 12, 9, 8, 21, 12, 15, 15, 30, 16, 30, 40, 35, 60, 21, 57, 24, 24, 90, 63, 27, 28, 12, 12, 31, 220, 33, 63, 180, 420, 37, 225, 39, 24, 182, 99, 60, 40, 306, 264, 195, 48, 49, 60, 51, 144, 306, 84, 462, 60, 264, 265, 180, 240, 35, 35, 63, 144, 612, 544, 67, 1012, 870, 84, 840, 72, 195, 264, 180, 312, 650, 1023, 79, 180, 81, 228, 63, 84, 1740, 783, 87, 88
Offset: 3
Keywords
Examples
For n=5, the shuffle of 1,2,3,4,5 is 3,5,1,4,2 (1st shuffle), which becomes 1,2,3,4,5 (2nd shuffle, already original order), so a(5)=2
Programs
-
Maple
trackIn := proc(L) local ret,po,k ; ret := [op(1,L)] ; po := 1 ; for k from 2 to nops(L) do if type(k,'even') then ret := [op(1..po,ret),op(k,L),op(po+1..nops(ret),ret)] ; else ret := [op(1..po-1,ret),op(k,L),op(po..nops(ret),ret)] ; po := po+1 ; end if; end do: ret ; end proc: A238373 := proc(n) local ca,org,tu ; ca := [seq(k,k=1..n)] ; org := [seq(k,k=1..n)] ; for tu from 1 do ca := trackIn(ca) ; if ca = org then return tu; end if: end do: end proc: seq(A238373(n),n=3..88)
Comments