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!)
A337191 If cards numbered 1 through n are "Down Two Table" shuffled (top two put on bottom one at a time, third from top card dealt to table) until all of the cards are placed on the table, a(n) is the number of the last card dealt. 0

%I #26 Sep 04 2020 04:05:02

%S 1,1,1,4,4,1,7,4,1,7,4,10,7,13,10,16,13,1,16,4,19,7,22,10,25,13,1,16,

%T 4,19,7,22,10,25,13,28,16,31,19,34,22,37,25,40,28,43,31,46,34,49,37,

%U 52,40,1,43,4,46,7,49,10,52,13,55,16,58,19,61,22,64,25,67

%N If cards numbered 1 through n are "Down Two Table" shuffled (top two put on bottom one at a time, third from top card dealt to table) until all of the cards are placed on the table, a(n) is the number of the last card dealt.

%C This sequence is related to the Josephus Problem, which can be modeled with the Australian Under Down Shuffle, one card placed under the deck, one card laid down on the table until all the cards are on the table.

%H <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a>

%F a(1) = 1, a(2) = 1, a(n) = (a(n-2) + 3) (mod n) if (a(n-2) + 3) (mod n) is not 0; a(n) = n if (a(n-2) + 3) (mod n)=0.

%F Any number n can be written as either 2*(3^k) + 2m (where 0 <= m < 3^k, k = 0,1,2,...) or 3^k + 2m (where 0 <= m < 3^k, k = 0,1,2,...), in either case a(n) = 3m + 1.

%o (PARI) a(n) = if (n <= 2, 1, my(x = (a(n-2) + 3) % n); if (x, x, n)); \\ _Michel Marcus_, Aug 20 2020

%Y Cf. A006257.

%K nonn

%O 1,4

%A _Robert W. Vallin_, Aug 18 2020

%E More terms from _Michel Marcus_, Aug 20 2020

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 April 24 13:08 EDT 2024. Contains 371945 sequences. (Running on oeis4.)