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.

Previous Showing 11-16 of 16 results.

A004306 Rook polynomials.

Original entry on oeis.org

1, 1, 2, 6, 24, 44, 80, 144, 264, 484, 888, 1632, 3000, 5516, 10144, 18656, 34312, 63108, 116072, 213488, 392664, 722220, 1328368, 2443248, 4493832, 8265444, 15202520, 27961792, 51429752, 94594060, 173985600, 320009408, 588589064, 1082584068, 1991182536
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of perfect matchings in the circulant graph with 2*n vertices with jumps 1 and 3. - Robert Israel, Jan 24 2019

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000803. 4th column of A008305.
Equals 2 * (A001644(n) + 1), n>3.

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x+ 2*x^3+13*x^4-3*x^5-6*x^6-10*x^7)/(1-2*x+x^4) )); // G. C. Greubel, Apr 22 2019
    
  • Mathematica
    Join[{1,1,2,6},LinearRecurrence[{2,0,0,-1},{24,44,80,144},40]] (* or *) CoefficientList[ Series[ (1-x+2x^3+13x^4- 3x^5- 6x^6- 10x^7)/ (1-2x+ x^4),{x,0,40}],x] (* Harvey P. Dale, Dec 13 2011 *)
  • PARI
    my(x='x+O('x^40)); Vec((1-x+2*x^3+13*x^4-3*x^5-6*x^6-10*x^7)/(1 -2*x+x^4)) \\ G. C. Greubel, Apr 22 2019
    
  • Sage
    ((1-x+2*x^3+13*x^4-3*x^5-6*x^6-10*x^7)/(1-2*x+x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Apr 22 2019

Formula

G.f.: (1 - x + 2*x^3 + 13*x^4 - 3*x^5 - 6*x^6 - 10*x^7)/(1 - 2*x + x^4).
a(n) = 2*a(n-1) - a(n-4); a(0)=1, a(1)=1, a(2)=2, a(3)=6, a(4)=24, a(5)=44, a(6)=80, a(7)=144. - Harvey P. Dale, Dec 13 2011

A000382 Restricted permutations.

Original entry on oeis.org

6, 11, 20, 36, 65, 119, 218, 400, 735, 1351, 2484, 4568, 8401, 15451, 28418, 52268, 96135, 176819, 325220, 598172, 1100209, 2023599, 3721978, 6845784, 12591359, 23159119, 42596260, 78346736, 144102113, 265045107, 487493954
Offset: 4

Views

Author

Keywords

Comments

The fourth column of A008305, divided by 4.

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

Cf. A008305, A000496 divided by 4, A020992.

Programs

  • Maple
    A000382:=-(-6+z+2*z**2+4*z**3+z**4)/(z-1)/(z**3+z**2+z-1); [Conjectured by Simon Plouffe in his 1992 dissertation.]
    a:= n-> if n<4 then 0 elif n=4 then 6 else (Matrix([[11,7,4,2]]). Matrix(4, (i,j)-> if (i=j-1) then 1 elif j=1 then [2,0,0,-1][i] else 0 fi)^(n-2))[1,4] fi: seq(a(n), n=4..30); # Alois P. Heinz, Aug 26 2008
  • Mathematica
    a[n_] := Which[n<4, 0, n == 4, 6, True, {11, 7, 4, 2}.MatrixPower[Table[Which[i == j-1, 1, j == 1, {2, 0, 0, -1}[[i]], True, 0], {i, 1, 4}, {j, 1, 4}], n-2] // Last]; Table[a[n], {n, 4, 27}] (* Jean-François Alcover, Mar 12 2014, after Alois P. Heinz *)

Formula

a(n) = a(n-1)+a(n-2)+a(n-3)-2 (conjectured).

Extensions

More terms from Vincenzo Librandi, Mar 14 2014

A321352 Triangle T(n,k) giving the number of permutations pi of {1,2,...,n} such that for all i, pi(i) is not in {i, i+1, ..., i+k-1} (mod n), with 0 <= k <= n - 1.

Original entry on oeis.org

1, 2, 1, 6, 2, 1, 24, 9, 2, 1, 120, 44, 13, 2, 1, 720, 265, 80, 20, 2, 1, 5040, 1854, 579, 144, 31, 2, 1, 40320, 14833, 4738, 1265, 264, 49, 2, 1, 362880, 133496, 43387, 12072, 2783, 484, 78, 2, 1, 3628800, 1334961, 439792, 126565, 30818, 6208, 888, 125, 2, 1
Offset: 1

Views

Author

Peter Kagey, Feb 25 2020

Keywords

Comments

This is A008305 with the rows reversed.
First column is A000142 (factorial numbers).
Second column is A000166 (derangements).
Third column is A000179 (ménage numbers).
Fourth column is A000183 (discordant permutations)

Examples

			Table begins:
       1
       2,      1
       6,      2,     1
      24,      9,     2,     1
     120,     44,    13,     2,    1
     720,    265,    80,    20,    2,   1
    5040,   1854,   579,   144,   31,   2,  1
   40320,  14833,  4738,  1265,  264,  49,  2, 1
  362880, 133496, 43387, 12072, 2783, 484, 78, 2, 1
		

Crossrefs

A048162 Expansion of (1 - x + 3*x^3 - 2*x^4 - 3*x^5)/(1 - 2*x + x^3).

Original entry on oeis.org

1, 1, 2, 6, 9, 13, 20, 31, 49, 78, 125, 201, 324, 523, 845, 1366, 2209, 3573, 5780, 9351, 15129, 24478, 39605, 64081, 103684, 167763, 271445, 439206, 710649, 1149853, 1860500, 3010351, 4870849, 7881198, 12752045, 20633241, 33385284
Offset: 0

Views

Author

Keywords

Comments

Number of permutations of 1..n such that each position is fixed or moves to an adjacent position (with n considered adjacent to 1). For example, a(4) = 9 because there is the identity; 2 cyclic permutations; 4 swaps of one pair of adjacent entries; and 2 swaps of two pairs of adjacent entries. - Joshua Zucker, Nov 13 2003

References

  • Lehmer, D. H.; Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

3rd column of A008305.
Cf. A001610.

Programs

  • Mathematica
    CoefficientList[Series[(1-x+3x^3-2x^4-3x^5)/(1-2x+x^3),{x,0,40}],x] (* or *) Join[{1,1,2},#[[3]]+#[[1]]+2&/@Partition[Fibonacci[Range[2,50]],3,1]] (* Harvey P. Dale, Apr 06 2017 *)

Formula

For n>4, a(n) = a(n-1) + a(n-2) - 2. - Joshua Zucker, Nov 13 2003
a(n) = Fibonacci(n+1) + Fibonacci(n-1) + 2, for n>2. - Jessa Lee (jessal(AT)comcast.net), Nov 25 2003
For n > 2, a(n)=A001610(n-1) - 3. - Toby Gottfried, Apr 13 2013

Extensions

Second formula corrected by David Radcliffe, Jan 16 2011

A345461 Triangle T(n,k) (n >= 1, 0 <= k <= n-1) read by rows: number of distinct permutations after k steps of the "optimist" algorithm.

Original entry on oeis.org

1, 2, 1, 6, 1, 1, 24, 6, 1, 1, 120, 38, 7, 1, 1, 720, 232, 53, 7, 1, 1, 5040, 1607, 404, 74, 7, 1, 1, 40320, 12984, 3383, 732, 108, 7, 1, 1, 362880, 117513, 31572, 7043, 1292, 167, 9, 1, 1, 3628800, 1182540, 324112, 75350, 14522, 2384, 260, 11, 1, 1
Offset: 1

Views

Author

Olivier Gérard, Jun 20 2021

Keywords

Comments

Start with the n! permutations of order n. Apply an iteration of the "optimist" sorting algorithm. Count the distinct permutations, until all are sorted.
The length of each row is n.
The optimist algorithm is: rotate right all currently unsorted letters by the distance between the first unsorted one and its sorted position. An example is given in A345453.

Examples

			Triangle begins:
.
     1;
     2,     1;
     6,     1,    1;
    24,     6,    1,   1;
   120,    38,    7,   1,  1;
   720,   232,   53,   7,  1,  1;
  5040,  1607,  404,  74,  7,  1,  1;
.
		

Crossrefs

Cf. A345453 (permutations according to number of steps for sorting).
Cf. A321352 and A008305 (the equivalent for Eulerian numbers).
Cf. A345462 (the equivalent for Stirling numbers of 1st kind).
Cf. A345464 (first column).

Formula

T(n,0) = n!; T(n,n-1) = 1; T(n,n-2) = 1 for n > 2.

A306738 Number of permutations of [n] allowing i->i+j (mod n), j=0..ceiling(n/2)-1.

Original entry on oeis.org

1, 1, 1, 2, 2, 13, 20, 144, 264, 2783, 6208, 79118, 204448, 3182225, 9411840, 170576156, 566725760, 11804363619, 43573050368, 1023207993178, 4152609019392, 108681408827381, 481065936784384, 13880706183899752
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2019

Keywords

Crossrefs

Cf. A008305.

Formula

a(n) = A008305(n,ceiling(n/2)).
Previous Showing 11-16 of 16 results.