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.

Showing 1-2 of 2 results.

A373416 Fixed points of A323712: sizes k of card decks that return to original order after k pile shuffles (but not earlier).

Original entry on oeis.org

1, 3, 4, 6, 9, 12, 22, 27, 28, 36, 46, 52, 60, 70, 78, 81, 100, 102, 148, 166, 172, 180, 190, 196, 198, 238, 243, 262, 268, 270, 292, 310, 316, 348, 358, 366, 372, 382, 388, 420, 460, 462, 478, 486, 502, 508, 540, 556, 598, 606, 612, 646, 652, 660, 676, 700, 708, 718, 729, 742
Offset: 1

Views

Author

R. J. Mathar, Aug 02 2024

Keywords

Comments

The pile shuffle of a card stack [1,2,3...,n] puts 1 at the bottom of a first auxiliary stack, 2 at the bottom of a second auxiliary stack, 3 above the 1, 4 above the 2, 5 above the 3, 6 above the 4.. eventually the shuffled stack is the first auxiliary stack on top of the second auxiliary stack.
Sequence A263458 contains sizes 2k of card decks that return to reverse order after k pile shuffles. They return to original order after 2k shuffles (2 reversals), so entries of A263458 are candidates for entries here. The case of 30 cards shows that this is not that simple: 30 cards are in reverse order after 5 shuffles, back to original order after 10 shuffles, in reverse order after 15 shuffles (so 30 is in A263458) etc. Because the return to normal order happens already after 10 shuffles (not only at 30), 30 is not in this sequence here.

Crossrefs

Cf. A323712, A163781 (even terms halved ?), A263458.

Formula

Equals the ordered set {k: A323712(k) = k}.

A263458 Deal a pack of n cards into two piles and gather them up, n/2 times. All n such that this reverses the order of the deck.

Original entry on oeis.org

4, 6, 12, 22, 28, 30, 36, 46, 52, 60, 70, 78, 100, 102, 108, 126, 148, 150, 156, 166, 172, 180, 190, 196, 198, 222, 228, 238, 262, 268, 270, 276, 292, 310, 316, 348, 358, 366, 372, 382, 388, 396, 420, 430, 438, 460, 462, 478, 486, 502, 508, 540, 556, 598
Offset: 1

Views

Author

Christian Perfect, Oct 19 2015

Keywords

Comments

This seems to be A003628(n)-1; that is, each element of this sequence is one less than a prime congruent to 5 or 7 modulo 8.

Examples

			Take a deck of 52 playing cards. Deal it into two piles, then pick up the first pile and put it on top of the other. Do this 26 times. The order of the deck is reversed, so 52 belongs to this sequence.
6 is in the sequence because the 3 shuffles are [1, 2, 3, 4, 5, 6] -> [5, 3, 1, 6, 4, 2] -> [4, 1, 5, 2, 6, 3] -> [6, 5, 4, 3, 2, 1], original reversed. 8 is not in the sequence because the 4 shuffles are [1, 2, 3, 4, 5, 6, 7, 8] -> [7, 5, 3, 1, 8, 6, 4, 2] -> [4, 8, 3, 7, 2, 6, 1, 5] -> [1, 2, 3, 4, 5, 6, 7, 8] -> [7, 5, 3, 1, 8, 6, 4, 2], not the original reversed. - _R. J. Mathar_, Aug 02 2024
		

Crossrefs

Programs

  • Maple
    isA263458 := proc(n)
        local L,itr ;
        L := [seq(i,i=1..n)] ;
        for itr from 1 to n/2 do
            L := pileShuf(L) ; # function code in A323712
        end do:
        for i from 1 to nops(L) do
            if op(-i,L) <> i then
                return false ;
            end if;
        end do:
        true ;
    end proc:
    n := 1;
    for k from 2 do
        if isA263458(k) then
            printf("%d %d\n",n,k) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Aug 02 2024
  • Sage
    from itertools import cycle
    def into_piles(r,deck):
        packs = [[] for i in range(r)]
        for card, pack in zip(range(1,deck+1),cycle(range(r))):
            packs[pack].insert(0,card)
        out = sum(packs,[])
        return Permutation(out)
    def has_reversing_property(deck):
        p = power(into_piles(2,deck), deck/2)
        return p==into_piles(1,deck)
    [i for i in range(2,400,2) if has_reversing_property(i)]
Showing 1-2 of 2 results.