The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 0
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
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.
LINKS
EXAMPLE
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.
PROG
(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)]
CROSSREFS
Sequence in context: A027150 A020141 A049478 * A163776 A050558 A331192
KEYWORD
nonn
AUTHOR
Christian Perfect, Oct 19 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 29 03:17 EDT 2024. Contains 372921 sequences. (Running on oeis4.)