cp's OEIS Frontend

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.

A245578 The number of permutations of {0,0,1,1,...,n-1,n-1} that begin with 0 and in which adjacent elements are adjacent mod n.

This page as a plain text file.
%I A245578 #30 Sep 08 2022 08:46:09
%S A245578 1,10,18,22,32,38,50,58,72,82,98,110,128,142,162,178,200,218,242,262,
%T A245578 288,310,338,362,392,418,450,478,512,542,578,610,648,682,722,758,800,
%U A245578 838,882,922,968,1010,1058,1102,1152,1198,1250,1298,1352,1402,1458,1510,1568,1622,1682,1738,1800,1858,1922,1982,2048,2110
%N A245578 The number of permutations of {0,0,1,1,...,n-1,n-1} that begin with 0 and in which adjacent elements are adjacent mod n.
%C A245578 a(n) is also the number of random walks of length 2n in which every residue class mod n occurs twice (except that there are 8 such walks when n=2).
%H A245578 Joerg Arndt, <a href="/A245578/b245578.txt">Table of n, a(n) for n = 2..1006</a>
%H A245578 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F A245578 a(n) = 2 * A209350(n) if n>2. - _Michael Somos_, Jul 26 2014
%F A245578 G.f.: x^2 * (1+8*x-2*x^2-12*x^3+7*x^4) / ((1+x) * (1-x)^3). - _Joerg Arndt_, Jul 26 2014
%F A245578 a(n) = (3+5*(-1)^n+8*n+2*n^2)/4 if n>2. - _Peter Luschny_, Jul 26 2014
%F A245578 E.g.f.: (5*exp(-x)+exp(x)*(2*x*(x+5)+3)-(14*x^2+8*(x+1)))/4. - _Peter Luschny_, Aug 04 2014
%e A245578 a(3)=10 because of the solutions 012012,012021,012102,012120,010212, and their complements mod 3.
%e A245578 G.f. = x^2 + 10*x^3 + 18*x^4 + 22*x^5 + 32*x^6 + 38*x^7 + 50*x^8 + 58*x^9 + ...
%p A245578 A245578 := n -> `if`(n=2, 1, (3+5*(-1)^n+8*n+2*n^2)/4);
%p A245578 seq(A245578(n), n = 2..63); # _Peter Luschny_, Jul 26 2014
%t A245578 CoefficientList[Series[(1 + 8 x - 2 x^2 - 12 x^3 + 7 x^4)/((1 + x) (1 - x)^3), {x, 0, 40}], x] (* _Vincenzo Librandi_, Aug 05 2014 *)
%o A245578 (PARI) Vec( x^2 * (1+8*x-2*x^2-12*x^3+7*x^4) / ((1+x) * (1-x)^3) + O(x^66) ) \\ _Joerg Arndt_, Jul 26 2014
%o A245578 (Magma) [1] cat [(3+5*(-1)^n+8*n+2*n^2)/4: n in [3..70]]; // _Vincenzo Librandi_, Aug 05 2014
%K A245578 nonn,easy
%O A245578 2,2
%A A245578 _Don Knuth_, Jul 25 2014