Take cards labelled 1 ... N. Shuffle them.
Repeat this procedure: look at the top card's value, X. Move X cards from the top of the deck to the back, one at a time.
If you ever end up back at your first card, you win.
Example A: the deck is in order 1 2 3. This is what happens:
1 2 3
2 3 1 (1 card to the back)
1 2 3 (2 cards to the back)
Win!
Example B: the deck is in order 1 3 2.
1 3 2
3 2 1 (1 card to the back)
3 2 1 (3 cards to the back)
Infinite loop: lose!
Example C: the deck is in order 2 1 4 3.
2 1 3 4
3 4 2 1
1 3 4 2
3 4 2 1
Infinite loop: lose!
How many of the N! shuffles of N cards will win?
I think the sequence goes 1, 1, 4, 10, 56, 304, which isn't in the OEIS. I'm happy with the 1,1,4,10, and some Python code which I'm happy with came up with the 56 and 304. Is this sequence hiding somewhere under a slightly different interpretation, or is it really new?
On mathstodon, Brent Yorgey (https://mathstodon.xyz/@byorgey/115304454402551860) suggested thinking of this in terms of function graphs: we're counting vertices on cycles in the graphs you get by drawing an edge from vertex X to whatever's X places on from there in the initial order.
--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/CAEMHSOjK5FxEJT1ic%3D5rrupZsB2UqeE9xhWWgspc%3DFKUkP95JQ%40mail.gmail.com.
Your sequence Axxx goes: 1, 1, 4, 10, 56, 304, 1956, 14856, 130008, 1237440, 13084540, 151656128, ...
This increasingly differs from A151884.
The "opposite" sequence Ayyy (shuffles that do *not* loop back to the starting position, such that $Ayyy(n) = n! - Axxx(n)$) goes:
0, 1, 2, 14, 64, 416, 3084, 25464, 232872, 2391360, 26832260, 327345472, ...
Seems like a reasonably interesting sequence to me. The most "arbitrary" choice in the setup is that we choose to number the cards from 1 to N, instead of from 0 to N-1 (which would make the sequence trivial), or from 2 to N+1, or from 10 to 10N, or whatever.
–Arthur
To view this discussion visit https://groups.google.com/d/msgid/seqfan/CAF0MJNp-WyiK-aNrVEuXfM-vBdhY0YzuqwP1pP43B_mzSm%2BHPA%40mail.gmail.com.