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-3 of 3 results.

A000313 Number of permutations of length n with 3 consecutive ascending pairs.

Original entry on oeis.org

0, 0, 0, 1, 4, 30, 220, 1855, 17304, 177996, 2002440, 24474285, 323060540, 4581585866, 69487385604, 1122488536715, 19242660629360, 348933579412440, 6673354706262864, 134252194678935321, 2834212998777523380, 62651024183503148470, 1447238658638922729580
Offset: 1

Views

Author

Keywords

Comments

Temporary remark: there may be some issues with respect to the offset of this sequence in the formula and program sections. - Joerg Arndt, Nov 16 2014

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • 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 in triangle A010027.

Programs

  • Maple
    series(hypergeom([2,4],[],x/(x+1))/(x+1)^4, x=0, 30); # Mark van Hoeij, Nov 07 2011
    a := n -> simplify(hypergeom([4-n,2],[],1))*(-1)^n*(n-1)*(n-2)*(n-3)/6: seq(a(n), n=1..23); # Peter Luschny, Nov 19 2014
  • Mathematica
    Table[(n*(n + 1)!/6)*Sum[(-1)^k/k!, {k, 0, n}], {n, -1, 25}] (* T. D. Noe, Jun 19 2012 *)
    a[1]:=0; a[n_Integer/;n>=2]:=(n-2) (n-1) Subfactorial[n-2]/6 (* Todd Silvestri, Nov 15 2014 *)
  • Sage
    a = lambda n: (n-2)*(n-1)*sloane.A000166(n-2)/6 if n>2 else 0
    [a(n) for n in range(1,24)] # Peter Luschny, Nov 19 2014

Formula

a(n) = (n*(n+1)!/6)*sum((-1)^k/k!, k=0..n).
a(n) = A065087(n+2)/3. - Zerinvary Lajos, May 25 2007
E.g.f.: x^3/3!*exp(-x)/(1-x)^2. - Vladeta Jovovic, Jan 03 2003
a(n) = round( (exp(-1)*(n+1)!+(-1)^n)*n/6 ). - Mark van Hoeij, Oct 25 2011
G.f.: hypergeom([2, 4],[],x/(x+1))/(x+1)^4. - Mark van Hoeij, Nov 07 2011
a(1) = 0, a(n) = (n-2)*(n-1)*(!(n-2))/6 = (n-2)*(n-1)*A000166(n-2)/6, for n >= 2. - Todd Silvestri, Nov 15 2014
a(n) = hypergeom([4-n,2],[],1)*(-1)^n*A000292(n-3). - Peter Luschny, Nov 19 2014
D-finite with recurrence (-n+4)*a(n) +(n-1)*(n-4)*a(n-1) +(n-1)*(n-2)*a(n-2)=0. - R. J. Mathar, Aug 01 2022

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Formula added by Sean A. Irvine, Nov 11 2010
Name clarified and offset changed by N. J. A. Sloane, Apr 12 2014

A305730 a(n) is the total displacement of all letters in all permutations of n letters with no fixed points.

Original entry on oeis.org

0, 0, 2, 8, 60, 440, 3710, 34608, 355992, 4004880, 48948570, 646121080, 9163171732, 138974771208, 2244977073430, 38485321258720, 697867158824880, 13346709412525728, 268504389357870642, 5668425997555046760, 125302048367006296940, 2894477317277845459160
Offset: 0

Views

Author

Seiichi Manyama, Jun 22 2018

Keywords

Examples

			n | 1 2 3 4 | the displacement of all letters | a(n)
--+---------+---------------------------------+------
2 | 2 1     | 1 + 1 = 2                       |   2
3 | 2 3 1   | 1 + 1 + 2 = 4                   |   8
  | 3 1 2   | 2 + 1 + 1 = 4                   |
4 | 2 1 4 3 | 1 + 1 + 1 + 1 = 4               |  60
  | 2 3 4 1 | 1 + 1 + 1 + 3 = 6               |
  | 2 4 1 3 | 1 + 2 + 2 + 1 = 6               |
  | 3 1 4 2 | 2 + 1 + 1 + 2 = 6               |
  | 3 4 1 2 | 2 + 2 + 2 + 2 = 8               |
  | 3 4 2 1 | 2 + 2 + 1 + 3 = 8               |
  | 4 1 2 3 | 3 + 1 + 1 + 1 = 6               |
  | 4 3 1 2 | 3 + 1 + 2 + 2 = 8               |
  | 4 3 2 1 | 3 + 1 + 1 + 3 = 8               |
		

Crossrefs

Programs

  • PARI
    {a(n) = n*(n+1)!/3*sum(k=0, n, (-1)^k/k!)}

Formula

a(n) = n * (n+1) * A000166(n)/3 = 2/3 * A065087(n).
a(n) = n * (n+1)!/3 * Sum_{k=0..n} (-1)^k/k!.
a(n) = n * (n+1) * (a(n-1)/(n-1) + (-1)^n/3) for n > 1.
a(n) = 2 * A000313(n+2). - Alois P. Heinz, Jun 22 2018
E.g.f.: exp(-x)*x^2*(3 - 2*x + x^2)/(3*(1 - x)^3). - Ilya Gutkovskiy, Jun 25 2018

A214261 List of derangements of 1, 2, 3, ..., n for n = 2, 3, 4, ..., in lexicographic order.

Original entry on oeis.org

2, 1, 2, 3, 1, 3, 1, 2, 2, 1, 4, 3, 2, 3, 4, 1, 2, 4, 1, 3, 3, 1, 4, 2, 3, 4, 1, 2, 3, 4, 2, 1, 4, 1, 2, 3, 4, 3, 1, 2, 4, 3, 2, 1, 2, 1, 4, 5, 3, 2, 1, 5, 3, 4, 2, 3, 1, 5, 4, 2, 3, 4, 5, 1, 2, 3, 5, 1, 4, 2, 4, 1, 5, 3, 2, 4, 5, 1, 3, 2, 4, 5, 3, 1, 2, 5, 1
Offset: 2

Views

Author

William Rex Marshall, Jul 08 2012

Keywords

Examples

			The derangements can be written as
21,
231, 312,
2143, 2341, 2413, 3142, 3412, 3421, 4123, 4312, 4321, etc.
		

Crossrefs

Cf. A000166, A030298, A065087 (row sums), A086325 (row lengths).
Showing 1-3 of 3 results.