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.
%I A145787 #17 Oct 07 2019 03:06:01 %S A145787 1,2,2,3,3,6,6,4,4,6,6,10,10,14,14,5,5,18,18,10,10,12,12,21,21,26,26, %T A145787 9,9,30,30,6,6,22,22,9,9,30,30,27,27,8,8,11,11,10,10,24,24,50,50,12, %U A145787 12,18,18,14,14,12,12,55,55,50,50,7,7,18,18,34,34,46,46 %N A145787 Number of times you have to move n cards from one pile to another doing one up, one down, until you obtain the initial sequence. %C A145787 Let's say you have 3 cards (1 - 2 - 3). You move 1, 2 over 1, 3 below 2. Now you have: (2-1-3). Now you repeat the movement: You move 2, 1 over 2, 3 below 2. Now you have: (1-2-3). The same initial scenario. Total 2 moves. With 4 cards you do it in three moves. For 8 cards you need 4 moves. For 16 cards you need 5 moves. I can assume that for 32 cards I will do it in 6 moves. But for 14 or 15 cards you need 14 moves. I don't know how to predict how many moves for n cards... %H A145787 Jon Maiga, <a href="/A145787/b145787.txt">Table of n, a(n) for n = 1..1000</a> %F A145787 a(n) = A019567(floor(n/2)). - _Jon Maiga_, Oct 06 2019 %t A145787 A019567[n_]:=For[m=1,True,m++,If[AnyTrue[{-1,1},Divisible[2^m+#,4n+1]&],Return[m]]]; (* from A019567 *) %t A145787 Table[A019567[Floor[n/2]],{n,80}] (* _Jon Maiga_, Oct 06 2019 *) %o A145787 (PARI) %o A145787 deck(n) = {s = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,;:!?.*%$£€=+-&()[]{}_"; v = Vec(s); ss = ""; for (i=1, n, ss = concat(ss, v[i]);); return (ss);} %o A145787 move(cards) = {v = Vec(cards); s = ""; for (i=1, length(v), if (i % 2, s = concat(s, v[i]), s = concat(v[i], s));); return (s);} %o A145787 a(n) = {cardsa = deck(n); cardsb = cardsa; diff = 1; nb = 0; while (diff, cardsb = move(cardsb); diff = (cardsa != cardsb); nb++;); return (nb);} %o A145787 \\ _Michel Marcus_, Mar 05 2013 %Y A145787 Cf. A019567. %K A145787 nonn %O A145787 1,2 %A A145787 Hernan Bonsembiante (hernanbon(AT)tutopia.com), Oct 19 2008 %E A145787 More terms from _Michel Marcus_, Mar 05 2013