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

A007060 Number of ways n married couples can sit in a row without any spouses next to each other.

Original entry on oeis.org

1, 0, 8, 240, 13824, 1263360, 168422400, 30865121280, 7445355724800, 2287168006717440, 871804170613555200, 403779880746418176000, 223346806774106790297600, 145427383048755178635264000, 110105698060190464791596236800, 95914116314126658718742347776000, 95252504853751428295192341381120000
Offset: 0

Views

Author

David Roberts Keeney (David.Roberts.Keeney(AT)directory.Reed.edu)

Keywords

Comments

Limit_{n->oo} a(n)/(2n)! = 1/e.
Also the number of (directed) Hamiltonian paths of the n-cocktail party graph. - Eric W. Weisstein, Dec 16 2013
Also the number of ways to label the cells of a 2 X n grid such that no vertically adjacent cells have adjacent labels. - Sela Fried, May 29 2023

Examples

			For n = 2, the a(2) = 8 solutions for the couples {1,2} and {3,4} are {1324, 1423, 2314, 2413, 3142, 3241, 4132, 4231}.
		

Crossrefs

Programs

  • Maple
    seq(add((-1)^i*binomial(n, i)*2^i*(2*n-i)!, i=0..n),n=0..20);
  • Mathematica
    Table[Sum[(-1)^i Binomial[n,i] (2 n - i)! 2^i, {i, 0, n}], {n, 0, 20}]
    Table[(2 n)! Hypergeometric1F1[-n, -2 n, -2], {n, 0, 20}]
  • PARI
    a(n)=sum(k=0, n, binomial(n, k)*(-1)^(n-k)*(n+k)!*2^(n-k)) \\ Charles R Greathouse IV, May 11 2016
    
  • Python
    from sympy import binomial, subfactorial
    def a(n): return sum([(-1)**(n - k)*binomial(n, k)*subfactorial(2*k) for k in range(n + 1)]) # Indranil Ghosh, Apr 28 2017

Formula

a(n) = (Pi*BesselI(n+1/2,1)*(-1)^n+BesselK(n+1/2,1))*exp(-1)*(2/Pi)^(1/2)*2^n*n!. - Mark van Hoeij, Nov 12 2009
a(n) = (-1)^n*2^n*n!*A000806(n), n>0. - Vladeta Jovovic, Nov 19 2009
a(n) = n!*hypergeom([-n, n+1],[],1/2)*(-2)^n. - Mark van Hoeij, Nov 13 2009
a(n) = 2^n * A114938(n). - Toby Gottfried, Nov 22 2010
a(n) = 2*n((2*n-1)*a(n-1) + (2*n-2)*a(n-2)), n > 1. - Aaron Meyerowitz, May 14 2014
From Peter Bala, Mar 06 2015: (Start)
a(n) = Sum_{k = 0..n} (-1)^(n-k)*binomial(n,k)*A000166(2*k).
For n >= 1, Integral_{x = 0..1} (x^2 - 1)^n*exp(x) dx = a(n)*e - A177840(n). Hence lim_{n->oo} A177840(n)/a(n) = e. (End)
a(n) ~ sqrt(Pi) * 2^(2*n+1) * n^(2*n + 1/2) / exp(2*n+1). - Vaclav Kotesovec, Mar 09 2016
a(n) = A173841(2n). - David Radcliffe, Sep 09 2025

Extensions

More terms from Michel ten Voorde, Apr 11 2001

A265863 T(n,k)=Number of nXk arrays containing k copies of 0..n-1 with no element plus any vertical neighbor equal to n-1.

Original entry on oeis.org

1, 1, 0, 1, 2, 2, 1, 0, 22, 8, 1, 6, 152, 384, 48, 1, 0, 1462, 22016, 19080, 240, 1, 20, 13772, 1584088, 11544576, 1019328, 1968, 1, 0, 139144, 124214208, 8616332520, 7521762432, 106546608, 13824, 1, 70, 1431824, 10318543104, 7213744082208
Offset: 1

Views

Author

R. H. Hardin, Dec 17 2015

Keywords

Comments

Table starts
......1...........1..............1..............1.............1
......0...........2..............0..............6.............0
......2..........22............152...........1462.........13772
......8.........384..........22016........1584088.....124214208
.....48.......19080.......11544576.....8616332520.7213744082208
....240.....1019328.....7521762432.71643177829872
...1968...106546608.11355242996304
..13824.11075595648
.140160

Examples

			Some solutions for n=3 k=4
..0..2..1..0....0..2..2..0....2..1..0..1....0..2..0..1....0..0..2..1
..0..1..2..0....1..2..1..0....2..2..1..0....1..2..0..2....0..0..1..2
..1..2..2..1....2..1..0..1....2..1..0..0....0..2..1..1....1..1..2..2
		

Crossrefs

Column 1 is A173841.
Row 2 is A126869.

A266158 T(n,k)=Number of nXk arrays containing k copies of 0..n-1 with no element plus any horizontal, vertical or antidiagonal neighbor equal to n-1.

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 16, 48, 0, 0, 0, 40, 1528, 240, 0, 0, 0, 272, 85976, 71328, 1968, 0, 0, 0, 5512, 7699384, 55409952, 10109856, 13824, 0, 0, 0, 149232, 895747208, 67579399344, 118728695856, 949116288, 140160, 0, 0, 0, 3741272, 121920870264
Offset: 1

Views

Author

R. H. Hardin, Dec 22 2015

Keywords

Comments

Table starts
.......1............0...............0................0...............0
.......0............0...............0................0...............0
.......2............0...............0................0...............0
.......8...........16..............40..............272............5512
......48.........1528...........85976..........7699384.......895747208
.....240........71328........55409952......67579399344.108728430936384
....1968.....10109856....118728695856.2180819465618592
...13824....949116288.185137301064192
..140160.197260755456
.1263360

Examples

			Some solutions for n=4 k=4
..3..1..1..0....0..2..2..3....1..1..1..0....0..1..1..3....0..1..3..2
..3..1..0..2....0..2..3..1....1..0..0..2....0..1..3..2....1..3..2..0
..1..0..2..2....2..3..1..0....0..2..2..3....1..3..2..0....1..3..2..0
..0..2..3..3....3..1..0..1....2..3..3..3....3..2..2..0....1..3..2..0
		

Crossrefs

Column 1 is A173841.

A266208 T(n,k)=Number of nXk arrays containing k copies of 0..n-1 with no element plus any horizontal, vertical, diagonal or antidiagonal neighbor equal to n-1.

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 8, 48, 0, 0, 0, 8, 544, 240, 0, 0, 0, 16, 7368, 20976, 1968, 0, 0, 0, 312, 225112, 5909712, 3124800, 13824, 0, 0, 0, 14936, 14336176, 2985074304, 12981441744, 269723136, 140160, 0, 0, 0, 310552, 1009920648, 2484237295056
Offset: 1

Views

Author

R. H. Hardin, Dec 23 2015

Keywords

Comments

Table starts
.......1...........0..............0..............0.............0..........0
.......0...........0..............0..............0.............0..........0
.......2...........0..............0..............0.............0..........0
.......8...........8..............8.............16...........312......14936
......48.........544...........7368.........225112......14336176.1009920648
.....240.......20976........5909712.....2985074304.2484237295056
....1968.....3124800....12981441744.95316232354752
...13824...269723136.19479242035200
..140160.61919980032
.1263360

Examples

			Some solutions for n=5 k=4
..1..1..1..1....1..4..4..4....2..0..3..2....2..0..1..1....0..0..0..3
..2..0..0..2....4..2..3..2....0..0..0..3....0..0..0..1....2..1..0..3
..0..0..3..3....3..3..3..0....1..1..2..3....3..3..2..1....1..1..2..3
..2..3..2..4....0..2..0..2....4..1..4..3....3..4..4..4....4..4..4..4
..4..4..3..4....1..1..0..1....4..1..4..2....2..4..2..3....2..3..2..1
		

Crossrefs

Column 1 is A173841.
Showing 1-4 of 4 results.