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.

Showing 1-10 of 18 results. Next

A001057 Canonical enumeration of integers: interleaved positive and negative integers with zero prepended.

Original entry on oeis.org

0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15, 16, -16, 17, -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23, 24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31, -31
Offset: 0

Views

Author

Keywords

Comments

Go forwards and backwards with increasing step sizes. - Daniele Parisse and Franco Virga, Jun 06 2005
The partial sums of the divergent series 1 - 2 + 3 - 4 + ... give this sequence. Euler summed it to 1/4 which was one of the first examples of summing divergent series. - Michael Somos, May 22 2007
From Peter Luschny, Jul 12 2009: (Start)
The general formula for alternating sums of powers is in terms of the Swiss-Knife polynomials P(n,x) A153641 2^(-n-1)(P(n,1)-(-1)^k P(n,2k+1)). Thus
a(k) = 2^(-2)(P(1,1)-(-1)^k P(1,2k+1)). (End)
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=4, a(n-3)=(-1)^(n-1)*coeff(charpoly(A,x),x). - Milan Janjic, Jan 26 2010
Cantor ordering of the integers producing a 1-1 and onto correspondence between the natural numbers and the integers showing that the set Z of integers has the same cardinality as the set N of natural numbers. The cardinal of N is the first transfinite cardinal aleph_null (or aleph_naught), which is the cardinality of a given infinite set if and only if it is countably infinite (denumerable), i.e., it can be put in 1-1 and onto correspondence (with a proper Cantor ordering) with the natural numbers. - Daniel Forgues, Jan 23 2010
a(n) is the determinant of the (n+2) X (n+2) (0,1)-Toeplitz matrix M satisfying: M(i,j)=0 iff i=j or i=j-1. The matrix M arises in the variation of ménage problem where not a round table, but one side of a rectangular table is considered (see comments of Vladimir Shevelev in A000271). Namely M(i,j) defines the class of permutations p of 1,2,...,n+2 such that p(i)<>i and p(i)<>i+1 for i=1,2,...,n+1, and p(n+2)<>n+2. And a(n) is also the difference between the number of even and odd such permutations. - Dmitry Efimov, Mar 02 2017

Examples

			G.f. = x - x^2 + 2*x^3 - 2*x^4 + 3*x^5 - 3*x^6 + 4*x^7 - 4*x^8 + 5*x^9 - 5*x^10 + ...
		

Crossrefs

Cf. A008619, A004526, A166711, A166871, A130472 (negation), A142150 (partial sums), A010551 (partial products for n > 0).
Alternating row sums of A104578 are a(n+1), for n >= 0.

Programs

  • Haskell
    a001057 n = (n' + m) * (-1) ^ (1 - m) where (n',m) = divMod n 2
    a001057_list = 0 : concatMap (\x -> [x,-x]) [1..]
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Maple
    a := n -> (1-(-1)^n*(2*n+1))/4; # Peter Luschny, Jul 12 2009
  • Mathematica
    Join[{0},Riffle[Range[35],-Range[35]]] (* Harvey P. Dale, Sep 21 2011 *)
    a[ n_] := -(-1)^n Ceiling[n/2]; (* Michael Somos, Jun 05 2013 *)
    LinearRecurrence[{-1, 1, 1}, {0, 1, -1}, 63] (* Jean-François Alcover, Jan 07 2019 *)
  • PARI
    {a(n) = if( n%2, n\2 + 1, -n/2)}; /* Michael Somos, Jul 20 1999 */
    
  • Python
    def a(n): return n//2 + 1 if n%2 else -n//2
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jul 14 2022

Formula

Euler transform of [-1, 2] is sequence a(n+1). - Michael Somos, Jun 11 2003
G.f.: x / ((1 + x) * (1 - x^2)). - Michael Somos, Jul 20 1999
E.g.f.: (exp(x) - (1 - 2*x) * exp(-x)) / 4. - Michael Somos, Jun 11 2003
a(n) = 1 - 2*a(n-1) -a(n-2); a(2*n) = -n, a(2*n+1) = n+1. - Michael Somos, Jul 20 1999
|a(n+1)| = A008619(n). |a(n-1)| = A004526(n). - Michael Somos, Jul 20 1999
a(n) = -a(n-1) + a(n-2) + a(n-3). a(n) = (-1)^(n+1) * floor((n+1) / 2). - Michael Somos, Jun 11 2003
a(1) = 1, a(n) = a(n-1)+n or a(n-1)-n whichever is closer to 0 on the number line. Or abs(a(n)) = min{abs(a(n-1)+n), abs(a(n-1)-n)}. - Amarnath Murthy, Jul 01 2003
a(n) = Sum_{k=0..n} k*(-1)^(k+1). - Paul Barry, Aug 20 2003
a(n) = (1-(2n+1)*(-1)^n)/4. - Paul Barry, Feb 02 2004
a(0) = 0; a(n) = (-1)^(n-1) * (n-|a(n-1)|) for n >= 1. - Rick L. Shepherd, Jul 14 2004
a(n) = a(n-1)-n*(-1)^n, a(0)=0; or a(n) = -a(n-1)+(1-(-1)^n)/2, a(0)=0. - Daniele Parisse and Franco Virga, Jun 06 2005
a(n) = ceiling(n/2) * (-1)^(n+1), n >= 0. - Franklin T. Adams-Watters, Nov 25 2011 (corrected by Daniel Forgues, Jul 21 2012)
a(n) = a(-1-n) for all n in Z. - Michael Somos, Jun 05 2013
Sum_{n>=1} 1/a(n) = 0. - Jaume Oliver Lafont, Jul 14 2017

Extensions

Thanks to Michael Somos for helpful comments.
Name edited by Franklin T. Adams-Watters, Jan 30 2012

A000904 a(n) = (n+1)*a(n-1) + (n+2)*a(n-2) + a(n-3); a(1)=0, a(2)=3, a(3)=13.

Original entry on oeis.org

0, 3, 13, 83, 592, 4821, 43979, 444613, 4934720, 59661255, 780531033, 10987095719, 165586966816, 2660378564777, 45392022568023, 819716784789193, 15620010933562688, 313219935456042955, 6593238655510464741, 145364470356686267259, 3349976056859294611696
Offset: 1

Views

Author

Keywords

Comments

Numbers connected with the ménage problem (cf. A000179).

Examples

			G.f. = 3 x^2 + 13 x^3 + 83 x^4 + 592 x^5 + 4821 x^6 + 43979 x^7 + 444613 x^8 + ...
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a000904_list = 0 : 3 : 13 : zipWith (+) a000904_list
       (zipWith (+) (zipWith (*) [6..] $ drop 1 a000904_list)
                    (zipWith (*) [5..] $ drop 2 a000904_list))
    -- Reinhard Zumkeller, Nov 22 2011
  • Mathematica
    max = 19; f[x_] = 1/(x+x^2)^2 * Sum[ n!*(x/(1+x)^2)^n, {n, 0, max+2}]; Series[ f[x]+1/x-1/x^2, {x, 0, max}] // CoefficientList[#, x]& // Rest (* Jean-François Alcover, May 16 2013, after Vladeta Jovovic *)
    RecurrenceTable[{a[1]==0,a[2]==3,a[3]==13,a[n]==(n+1)a[n-1]+(n+2)a[n-2]+a[n-3]},a,{n,20}] (* Harvey P. Dale, Aug 03 2016 *)

Formula

G.f.: (1/(x+x^2)^2)*Sum_{n>=0} n!*(x/(1+x)^2)^n. - Vladeta Jovovic, Jun 29 2007
G.f.: (1/E(0)-1+x-x^2)/x^2 where E(k) = (1+x)^2 + k*x - (k+1)*x*(1+x)^2/E(k+1); (continued fraction, Euler's 1st kind, 1-step). - Sergei N. Gladkovskii, Sep 17 2012
From Vladimir Shevelev, Jun 29 - Jul 22 2015: (Start)
Using formulas in [Lucas], we have
(i) a(1)=0, a(2)=3, for n>=3, a(n) = (n+2)*a(n-1) + a(n-2) + 2*(-1)^n
(Note that (i) yields a(3)=13 and, for n>=4,
a(n-1) = (n+1)*a(n-2) + a(n-3) - 2*(-1)^n. Summing this with (i), we see that (i) defines A000904);
(ii) for n>=1, a(n) = (A000179(n+3) + 2*(-1)^n)/(n+3);
(iii) for n>=3, a(n) = a(n-2) + A000179(n+2);
(iii)* if n is even, then a(n) = Sum_{i=0..(n+2)/2} A000179(2*i);
(iii)** if n is odd, then a(n) = Sum_{i=2..(n+1)/2} A000179(2*i+1).
Also
(iv) a(n+1) = A000271(n+3) - a(n);
(iv)* a(n) = Sum_{i=0..n+2}(-1)^i*A000271(n-i+2);
(v) a(n-2) = Sum_{i=0..n}(-1)^i*binomial(2*n-i+1, i)*(n-i)!, n>=3.
Note that Lucas considered this sequence with other initials. His formulas (i) - (iii), which he proved on pp. 491-495 of his book [Lucas], we wrote for the current initials.
The other 5 formulas, including the explicit formula 5), are new and we give their proofs:
(iii)*,(iii)**. Formulas (iii)* and (iii)** are obtained by the direct summation of (iii) over even and odd values respectively, taking into account the initials.
(iv). To obtain (iv), write (iii) in the form
a(j+1) - a(j) = -(a(j) - a(j-1)) + A000179(j+3), j>=2.
Summing Sum_{j=2..n}, we have
a(n+1) - a(2) = -a(n) + a(1) + Sum_{j=2..n}A000179(j+3). Since a(1)=0, a(2)=3, we find
a(n+1)-3 = -a(n) + Sum_{i=5..n+3}A000179(i). But A000179(3)=1, A000179(4)=2. Therefore, we have
a(n+1) = -a(n) + Sum_{i=3..n+3}A000179(i).
It is left to note that, by the definition,
A000271(n) = Sum{i=3..n}A000179(i). So
a(n+1) = A000271(n+3) - a(n).
(iv)*. In view of the first four initials 1,0,0,1 of A000271, we have
Sum_{i=0..n+2}(-1)^i*A000271(n-i+2) = Sum_{i=0..n-2}(-1)^i*A000271(n-i+2) and, by (iv), the last sum equals
Sum_{i=0..n-2}(-1)^i(a(n-i)+a(n-i-1)) = a(n) + (-1)^(n-2)*a(1) = a(n).
(v). We use induction for n>=3. In case n=3 (v) gives 6-6*2+10-4=0 = a(1). Set n:=n+2.
Suppose for some (now n>=1) we have
a(n) = Sum_{i=0..n+2} (-1)^i*binomial(2*n-i+5, i)*(n+2-i)! (*)
Further we use (iv). In A259212 we proved an explicit formula for A000271(n-1) such that we have
A000271(n+3) = Sum_{j=0..n+3}(-1)^j * binomial(2*n-j+6,j)*(n-j+3)!, n>3.
Now, by (iv) and (*) with changing summing j=i+1, we have
a(n+1) = Sum_{j=0..n+3} (-1)^j*binomial(2*n-j+6,j)*(n-j+3)! + Sum_{j=1..n+3} (-1)^j*binomial(2*n-j+6, j-1)*(n+3-j)!
Since binomial(n,-1)=0, then in the second sum the summing could begin with j=0.
So, we have
a(n+1) = Sum_{j=0..n+3} (-1)^j*binomial(2*n-j+7, j)*(n+3-j)! = Sum_{j=0..n+3} (-1)^j*binomial(2*(n+1)-j+5,j)*((n+1)+2-j)!
Thus this expression formally is obtained from (*) by replacing n with n+1.
QED (End)
a(n) ~ n! * n^2 / exp(2). - Vaclav Kotesovec, Jul 04 2015

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 27 2001

A013999 From applying the "rational mean" to the number e.

Original entry on oeis.org

1, 1, 2, 8, 42, 258, 1824, 14664, 132360, 1326120, 14606640, 175448160, 2282469840, 31972303440, 479793807360, 7679384173440, 130586660507520, 2351111258805120, 44679858911251200, 893744703503769600, 18771276190401504000, 413017883356110278400
Offset: 0

Views

Author

Domingo Gomez Morin (Dgomezm(AT)etheron.net)

Keywords

Comments

Binomial transform of A000271. - Vladeta Jovovic, Jun 26 2007
Conjecture: this is also the number of acyclic orientations of the complement of the path graph. - Martin Rubey, Oct 15 2023

Crossrefs

Cf. A000271.

Programs

  • Mathematica
    Table[SeriesCoefficient[Sum[k!*(x*(1-x))^k,{k,0,n}],{x,0,n}],{n,1,20}] (* Vaclav Kotesovec, Oct 07 2012 *)
  • Maxima
    makelist(sum(binomial(n-k+1,k)*(-1)^k*(n-k+1)!,k,0,floor((n+1)/2)),n,0,20); /* Emanuele Munarini, Jul 01 2013 */

Formula

G.f.: Sum_{n>=0} n!*(x*(1-x))^n. - Vladeta Jovovic, Jun 26 2007
Recurrence: a(n) = (n+3)*a(n-1) - (2*n+1)*a(n-2) + n*a(n-3). - Vaclav Kotesovec, Oct 07 2012
G.f.: 1/Q(0), where Q(k)= 1 + x/(1-x) - x*(k+2)/(1 - x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 21 2013
a(n) = sum(binomial(n-k+1,k)*(-1)^k*(n-k+1)!, k=0..floor((n+1)/2)). - Emanuele Munarini, Jul 01 2013
a(n) ~ n!*n/exp(1). - Vaclav Kotesovec, Jul 06 2013

A000425 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 0, 0, 8, 30, 192, 1344, 10800, 97434, 976000, 10749024, 129103992, 1679495350, 23525384064, 353028802560, 5650370001120, 96082828074162, 1729886440780800, 32874134679574208, 657589108734075240, 13811277748363437006, 303884178002526338624
Offset: 1

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A058087. Cf. A000179.

Programs

  • Mathematica
    p[n_] := Sum[2*n/(2*n-k)*Binomial[2*n-k, k]*(n-k)!*(x-1)^k, {k, 0, n}] // CoefficientList[#, x]&; Array[p, 25][[All, 2]] (* Jean-François Alcover, Feb 08 2016 *)

Formula

It appears that a(n) = round(4*n*exp(-2)*(BesselK(n-1,2)+BesselK(n,2))) when n >= 10. - Mark van Hoeij, Oct 25 2011
Conjecture: (n-1)*(n-3)*a(n) -n*(n-2)*(n-3)*a(n-1) -n*(n-1)*(n-3)*a(n-2) -n *(n-1)*a(n-3)=0. - R. J. Mathar, Nov 02 2015
Conjecture: a(n) = 2*n*A000271(n). - R. J. Mathar, Nov 02 2015

A058057 Triangle giving coefficients of ménage hit polynomials.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 3, 1, 1, 1, 6, 6, 8, 3, 1, 10, 20, 38, 35, 16, 1, 15, 50, 134, 213, 211, 96, 1, 21, 105, 385, 915, 1479, 1459, 675, 1, 28, 196, 952, 3130, 7324, 11692, 11584, 5413, 1, 36, 336, 2100, 9090, 28764, 65784, 104364, 103605, 48800
Offset: 0

Views

Author

N. J. A. Sloane, Dec 02 2000

Keywords

Comments

Triangle of coefficients of polynomials P(n; x) = Permanent(M), where M=[m(i,j)] is n X n matrix defined by m(i,j)=x if 0<=i-j<=1 else m(i,j)=1. - Vladeta Jovovic, Jan 23 2003

Examples

			1; 1,0; 1,1,0; 1,3,1,1; 1,6,6,8,3; ...
		

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 198.

Crossrefs

Programs

  • Maple
    V := proc(n) local k; add( binomial(2*n-k,k)*(n-k)!*(x-1)^k, k=0..n); end; W := proc(r,s) coeff( V(r),x,s ); end; a := (n,k)->W(n,n-k);
  • Mathematica
    max = 9; f[x_, y_] := Sum[n!*((x*y)^n/(1 + x*(y-1))^(2*n+1)), {n, 0, max}]; Flatten[ MapIndexed[ Take[#1, #2[[1]]] & , CoefficientList[ Series[f[x, y], {x, 0, max}, {y, 0, max}], {x, y}]]] (*Jean-François Alcover, Jun 29 2012, after Vladeta Jovovic *)

Formula

G.f.: Sum(n!*(x*y)^n/(1+x*(y-1))^(2*n+1),n=0..infinity). [Vladeta Jovovic, Dec 13 2009]

A259212 A total of n married couples, including a mathematician M and his wife W, are to be seated at the 2n chairs around a circular table. M and W are the first couple allowed to choose chairs, and they choose two chairs next to each other. The sequence gives the number of ways of seating the remaining couples so that women and men are in alternate chairs but M and W are the only couple seated next to each other.

Original entry on oeis.org

0, 0, 0, 6, 72, 1920, 69120, 3402000, 218252160, 17708544000, 1773002649600, 214725759494400, 30941575378560000, 5231894853375590400, 1025881591718766182400, 230901375630648602880000, 59127083048250564931584000, 17091634972762948947148800000
Offset: 1

Views

Author

Vladimir Shevelev, Jun 21 2015

Keywords

Comments

After M and W are seated at neighboring chairs, the problem of enumerating the ways of seating the remaining n-1 married couples is equivalent to the following problem: find the number of ways of seating n-1 married couples at 2*(n-1) chairs in a straight line, men and women in alternate chairs, so that no husband is next to his wife. According to our comment in A000271, this problem has a solution 2*(n-1)!*A000271(n-1), n >= 2. Here the coefficient 2 should be replaced by 1, since the place of the first woman W, by the condition, is already fixed.
Also the number of Hamiltonian paths in the (n-1)-crown graph for n > 3. - Eric W. Weisstein, Mar 27 2018

Crossrefs

Programs

  • Mathematica
    a[n_] := (n-1)! Sum[(-1)^(n-k+1) k! Binomial[n+k-1, 2k], {k, 0, n}]; a[1] = 0; Array[a, 18] (* Jean-François Alcover, Sep 03 2016 *)
    Join[{0}, Table[-(-1)^n (n - 1)! HypergeometricPFQ[{1, 1 - n, n}, {1/2}, 1/4], {n, 2, 20}]] (* Eric W. Weisstein, Mar 27 2018 *)
  • PARI
    a(n) = if (n==1, 0, my(m=n-1); m!*sum(k=0, m, binomial(2*m-k,k)*(m-k)!*(-1)^k)); \\ Michel Marcus, Jun 26 2015

Formula

a(n) = (n-1)!*A000271(n-1), for n > 1.
From Vladimir Shevelev, Jul 07 2015: (Start)
Consider the general formula for solution A(r,n) in A258673 without the restriction A(r,n)=0 for n <= (d+1)/2 in case d=2*n-1. The case when M and W sit at neighboring chairs corresponds to d=1, r=2 or d=2*n-1, r=n+1. In both cases, from this formula we have
A(r,n) = a(n)/(n-1)! = Sum_{j=0..n-1} (-1)^j * binomial(2*n-j-2,j)*(n-j-1)!, n > 1. (End)

Extensions

More terms from Peter J. C. Moses, Jun 21 2015

A047922 Triangle of numbers a(n,k) = number of terms in n X n determinant with 2 adjacent diagonals of k and k-1 0's (0<=k<=n).

Original entry on oeis.org

1, 1, 0, 2, 1, 0, 6, 4, 1, 1, 24, 18, 8, 5, 3, 120, 96, 54, 34, 23, 16, 720, 600, 384, 258, 182, 131, 96, 5040, 4320, 3000, 2136, 1566, 1168, 883, 675, 40320, 35280, 25920, 19320, 14664, 11274, 8756, 6859, 5413, 362880, 322560, 246960, 190800, 149160, 117696, 93582, 74902, 60301, 48800
Offset: 0

Views

Author

Keywords

Examples

			Triangle starts:
  1;
  1, 0;
  2, 1, 0;
  6, 4, 1, 1;
  ...
		

Crossrefs

Columns give A000142, A001563, A002775, A002776. Cf. A047920.

Programs

  • Maple
    a:= proc(n, k) option remember; `if`(k=0, n!, `if`(n=k,
          `if`(n<3, (n-1)*(n-2)/2, (n-1)*(a(n-1$2)+a(n-2$2))
          +a(n-3$2)), a(n, k+1) +2*a(n-1, k) +a(n-2, k-1)))
        end:
    seq(seq(a(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Jun 24 2017
  • Mathematica
    a[n_, n_] := (-1)^n*HypergeometricPFQ[{1, -n, n+1}, {1/2}, 1/4]; a[n_, k_] := a[n, k] = a[n, k+1] + 2*a[n-1, k] + a[n-2, k-1]; Table[a[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 24 2015 *)

Formula

Right diagonal is A000271, column k=0 is A000142; other entries given by a(n, k) = a(n, k+1) + 2a(n-1, k) + a(n-2, k-1).

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 29 2000

A078480 Number of permutations p of {1,2,...,n} such that |p(i)-i| != 1 for all i.

Original entry on oeis.org

1, 1, 1, 2, 5, 21, 117, 792, 6205, 55005, 543597, 5922930, 70518905, 910711193, 12678337945, 189252400480, 3015217932073, 51067619064873, 916176426422089, 17355904144773970, 346195850534379613, 7252654441500887309
Offset: 0

Views

Author

Vladeta Jovovic, Jan 03 2003

Keywords

Comments

For positive n, a(n) equals the permanent of the n X n matrix with 0's along the superdiagonal and the subdiagonal, and 1's everywhere else. [John M. Campbell, Jul 09 2011]

Crossrefs

Column k=0 of A320582.
Column k=1 of A306512.

Programs

  • Mathematica
    (* Explicit formula: *) Table[Sum[Sum[(-1)^k*(i-k)!*Binomial[2i-k,k],{k,0,i}],{i,0,n}],{n,0,21}] (* Vaclav Kotesovec, Mar 28 2011 *)

Formula

G.f.: 1/(1-x^2)*Sum_{n>=0} n!*(x/(1+x)^2)^n. - Vladeta Jovovic, Jun 26 2007
Asymptotic (N. S. Mendelsohn, 1956): a(n)/n! -> 1/e^2
Recurrence: a(n) = n*a(n-1) - (n-2)*a(n-3) - a(n-4), for n>=5

A000426 Coefficients of ménage hit polynomials.

Original entry on oeis.org

0, 1, 1, 1, 8, 35, 211, 1459, 11584, 103605, 1030805, 11291237, 135015896, 1749915271, 24435107047, 365696282855, 5839492221440, 99096354764009, 1780930394412009, 33789956266629001, 674939337282352360, 14157377139256183723, 311135096550816014651
Offset: 1

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 198.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • H. M. Taylor, A problem on arrangements, Mess. Math., 32 (1902), 60ff.

Crossrefs

Cf. A000179, A000271. A diagonal of A058057.

Programs

  • Magma
    [0] cat [&+[(-1)^k*Factorial(2*n-k-1)*Factorial(n-k) / (Factorial(2*n-2*k)*Factorial(k-2)): k in [2..n]]: n in [2..25]]; // Vincenzo Librandi, Jun 11 2019
  • Mathematica
    Table[Sum[(-1)^k*(2*n-k-1)!*(n-k)!/((2*n-2*k)!*(k-2)!),{k,2,n}],{n,1,20}] (* Vaclav Kotesovec, Oct 26 2012 *)

Formula

a(n) = Sum_{k=2..n} (-1)^k*(2n-k-1)!*(n-k)!/((2n-2k)!*(k-2)!).
a(n) = A000033(n)/n.
a(n) = ((2*n-5)*a(n-1) + (5*n-11)*a(n-2) + (5*n-14)*a(n-3) + (2*n-5)*a(n-4) + 2*a(n-5))/2 for n >= 6.
Shorter recurrence: (14*n-67)*a(n) = (14*n^2-95*n+137)*a(n-1) + (14*n^2-105*n+180)*a(n-2) - 24*a(n-4) + (57-10*n)*a(n-3). - Vaclav Kotesovec, Oct 26 2012
a(n) ~ 2/e^2*(n-1)!. - Vaclav Kotesovec, Oct 26 2012
a(n) = round((exp(-2)*(8*BesselK(n,2) - (4*n-10)*BesselK(n-1,2)))) for n > 6. - Mark van Hoeij, Jun 09 2019
a(n)+2*a(n+p)+a(n+2*p) is divisible by p for any prime p. - Mark van Hoeij, Jun 13 2019

Extensions

Edited by David W. Wilson, Dec 27 2007

A001887 Number of permutations p of {1,2,...,n} such that p(i) - i < 0 or p(i) - i > 2 for all i.

Original entry on oeis.org

1, 0, 0, 0, 1, 5, 33, 236, 1918, 17440, 175649, 1942171, 23396353, 305055960, 4280721564, 64330087888, 1030831875953, 17545848553729, 316150872317105, 6012076099604308, 120330082937778554
Offset: 0

Views

Author

Keywords

Comments

Previous name was: Hit polynomials.

References

  • J. Riordan, The enumeration of permutations with three-ply staircase restrictions, unpublished memorandum, Bell Telephone Laboratories, Murray Hill, NJ, Oct 1963. (See A001883)
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    nmax = 21;
    gf = 1/(x^2-1)(x-Sum[n! (x(x-1)/(x^3-2x-1))^n + O[x]^nmax, {n, 0, nmax}]);
    CoefficientList[gf, x] (* Jean-François Alcover, Aug 19 2018 *)

Formula

G.f.: (1/(x^2-1))*(x-Sum_{n>=0} n!*(x*(x-1)/(x^3-2*x-1))^n). - Vladeta Jovovic, Jun 30 2007
D-finite with recurrence (P. Flajolet, 1997): a(n) = (n-1)*a(n-1) + (n+2)*a(n-2) - (3*n-13)*a(n-3) - (2*n-8)*a(n-4) + (3*n-15)*a(n-5) + (n-4)*a(n-6) - (n-7)*a(n-7) - a(n-8), n>8.
a(n) ~ exp(-3) * n!. - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Vladimir Baltic and Vladeta Jovovic, Jan 05 2003
New name from Vaclav Kotesovec using a former comment by Vladimir Baltic and Vladeta Jovovic, Sep 16 2014
Showing 1-10 of 18 results. Next