%I M1909 #43 Jul 10 2021 06:58:20
%S 2,8,24,24,1920,7680,322560,64,92897280,3715891200,40874803200,
%T 194641920,25505877196800,1428329123020800,21424936845312000,160,
%U 23310331287699456000,1678343852714360832000,31888533201572855808000
%N Order of group generated by perfect shuffles of 2n cards.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Vincenzo Librandi, <a href="/A007346/b007346.txt">Table of n, a(n) for n = 1..200</a>
%H Steve Butler, Persi Diaconis and R. L. Graham, <a href="https://arxiv.org/abs/1412.8533">The mathematics of the flip and horseshoe shuffles</a>, arXiv:1412.8533 [math.CO], 2014.
%H Steve Butler, Persi Diaconis and R. L. Graham, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.123.6.542">The mathematics of the flip and horseshoe shuffles</a>, The American Mathematical Monthly 123.6 (2016): 542-556.
%H P. Diaconis, R. L. Graham and W. M. Kantor, <a href="http://dx.doi.org/10.1016/0196-8858(83)90009-X">The mathematics of perfect shuffles</a>, Adv. Appl. Math. 4 (2) (1983) 175-196.
%H <a href="/index/Gre#groups">Index entries for sequences related to groups</a>
%F See Maple program. - _N. J. A. Sloane_, Jun 20 2016
%p f:=proc(n) local k,i,np;
%p if n=1 then 2
%p elif (n mod 2) = 1 then n!*2^(n-1)
%p elif n=6 then 2^9*3*5
%p elif n=12 then 2^17*3^3*5*11
%p elif n=2 then 8
%p elif (n mod 4)=2 then n!*2^n
%p else
%p np:=n; k:=1;
%p for i while (np mod 2) = 0 do
%p np:=np/2; k:=k+1; od;
%p if (n=2^(k-1)) then k*2^k else n!*2^(n-2); fi;
%p fi;
%p end;
%p [seq(f(n),n=1..64)]; # _N. J. A. Sloane_, Jun 20 2016
%t a[1] = 2; a[2] = 8; a[n_] := With[{m = 2^n*n!}, Which[Mod[n, 4] == 2, If[n == 6, m/6, m], Mod[n, 4] == 1, m/2, Mod[n, 4] == 3, m/2, True, If[n == 2^IntegerExponent[n, 2], 2*n*(IntegerExponent[n, 2] + 1), If[n == 12, m/(2*7!), m/4]]]]; Table[a[n], {n, 1, 19}](* _Jean-François Alcover_, Feb 17 2012, after _Franklin T. Adams-Watters_ *)
%o (PARI) A007346(n) = local(M); M=2^n*n!; if(n%4==2, if(n==2, 8, if(n==6, M/6, M)), if(n%4==1, if(n==1, 2, M/2), if(n%4==3, M/2, if(n==2^valuation(n, 2), 2*n*(valuation(n, 2)+1), if(n==12, M/(7!*2), M/4))))) \\ _Franklin T. Adams-Watters_, Nov 30 2006
%Y Cf. A002326, A024222, A274299.
%Y Bisections give A002671, A274303.
%K nonn,nice,easy
%O 1,1
%A _N. J. A. Sloane_, _Mira Bernstein_
%E Corrected and extended by _Franklin T. Adams-Watters_, Nov 30 2006