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

A259776 Number A(n,k) of permutations p of [n] with no fixed points and displacement of elements restricted by k: 1 <= |p(i)-i| <= k, square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 4, 0, 0, 1, 0, 1, 2, 9, 6, 1, 0, 1, 0, 1, 2, 9, 24, 13, 0, 0, 1, 0, 1, 2, 9, 44, 57, 24, 1, 0, 1, 0, 1, 2, 9, 44, 168, 140, 45, 0, 0, 1, 0, 1, 2, 9, 44, 265, 536, 376, 84, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Jul 05 2015

Keywords

Comments

Conjecture: Column k > 0 has a linear recurrence (with constant coefficients) of order = A005317(k) = (2^k + C(2*k,k))/2. - Vaclav Kotesovec, Jul 07 2015
From Vaclav Kotesovec, Jul 07 2015: (Start) For k > 1, A(n,k) ~ c(k) * d(k)^n
k c(k) d(k)
2 0.2840509026895102746628049030651... 1.8832035059135258641689474653620...
3 0.1678494211968692989590951622212... 2.6304414743928951523517253855770...
4 0.0973070675347403976445165510589... 3.3758288741377846847522960161445...
5 0.0552389982575367440330445172521... 4.1183824671958029895499633437571...
6 0.0309726120341077011398575643793... 4.8588208495640240252838055706997...
7 0.0172064353582683268003622374813... 5.5979905586951369718393573797927...
8 0.0094902135663231445267663712259... 6.3363450921766600853069060904417...
9 0.00520430877801650454166967632... 7.0741444217884608367707985...
10 0.0028405987031922... 7.811548995086...
(End)

Examples

			Square array A(n,k) begins:
  1, 1,  1,   1,   1,    1,    1,    1, ...
  0, 0,  0,   0,   0,    0,    0,    0, ...
  0, 1,  1,   1,   1,    1,    1,    1, ...
  0, 0,  2,   2,   2,    2,    2,    2, ...
  0, 1,  4,   9,   9,    9,    9,    9, ...
  0, 0,  6,  24,  44,   44,   44,   44, ...
  0, 1, 13,  57, 168,  265,  265,  265, ...
  0, 0, 24, 140, 536, 1280, 1854, 1854, ...
		

Crossrefs

Main diagonal gives: A000166.
Cf. A259784.

Programs

  • Maple
    b:= proc(n, s, k) option remember; `if`(n=0, 1, `if`(n+k in s,
          b(n-1, (s minus {n+k}) union `if`(n-k>1, {n-k-1}, {}), k),
          add(`if`(j=n, 0, b(n-1, (s minus {j}) union
          `if`(n-k>1, {n-k-1}, {}), k)), j=s)))
        end:
    A:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), b(n, {$max(1, n-k)..n}, k)):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[n_, s_, k_] := b[n, s, k] = If[n==0, 1, If[MemberQ[s, n+k], b[n-1, Join[s ~Complement~ {n+k}] ~Union~ If[n-k>1, {n-k-1}, {}], k], Sum[If[j==n, 0, b[n -1, Join[s ~Complement~ {j}] ~Union~ If[n-k>1, {n-k-1}, {}], k]], {j, s}]] ];
    A[n_, k_] := If[k == 0, If[n == 0, 1, 0], b[n, Range[Max[1, n-k], n], k]];
    Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Mar 29 2017, translated from Maple *)

Formula

A(n,k) = Sum_{j=0..k} A259784(n,j).

A260074 Number of permutations p of [n] with no fixed points and cyclic displacement of elements restricted by two: p(i)<>i and (i-p(i) mod n <= 2 or p(i)-i mod n <= 2).

Original entry on oeis.org

1, 0, 1, 2, 9, 44, 80, 144, 260, 448, 808, 1456, 2640, 4788, 8744, 16016, 29444, 54268, 100304, 185824, 344996, 641664, 1195400, 2230176, 4165904, 7790244, 14581640, 27316240, 51209124, 96060300, 180291280, 338538480, 635940356, 1195021888, 2246289704
Offset: 0

Views

Author

Alois P. Heinz, Jul 14 2015

Keywords

Comments

a(n) = A000166(n) for n <= 5.

Examples

			a(6) = 80: 214365, 214635, 215364, 215634, 231564, 231645, 234561, 234615, 235614, 235641, 241365, 241635, 245361, 245631, 261345, 261534, 264315, 264531, 265314, 265341, 312564, 312645, 314265, 314562, 315264, 315642, 341265, 341562, 342561, 342615, 345261, 345612, 361245, 361542, 362514, 362541, 364215, 364512, 365214, 365241, 512364, 512634, 514362, 514632, 531264, 531642, 532614, 532641, 534261, 534612, 541362, 541632, 542361, 542631, 561234, 561342, 562314, 562341, 564231, 564312, 612345, 612534, 614235, 614532, 615234, 615342, 631245, 631542, 632514, 632541, 634215, 634512, 635214, 635241, 641235, 641532, 642315, 642531, 645231, 645312.
		

Crossrefs

Programs

  • Maple
    gf:= -(27*x^14 -13*x^13 -61*x^12 -4*x^11 -70*x^10 +50*x^9 +44*x^8 +10*x^7 +38*x^6 -24*x^5 -6*x^4 +2*x^3 -3*x^2 +3*x-1) / ((x-1) *(x+1) *(x^2+1) *(x^2+x-1) *(x^4-2*x^3+x^2-2*x+1)):
    a:= n-> coeff(series(gf, x, n+1), x, n):
    seq(a(n), n=0..50);
  • Mathematica
    LinearRecurrence[{3,-2,1,-1,-4,3,-1,2,1,-1},{1,0,1,2,9,44,80,144,260,448,808,1456,2640,4788,8744},50] (* Harvey P. Dale, Jul 15 2019 *)

Formula

G.f.: -(27*x^14 -13*x^13 -61*x^12 -4*x^11 -70*x^10 +50*x^9 +44*x^8 +10*x^7 +38*x^6 -24*x^5 -6*x^4 +2*x^3 -3*x^2 +3*x-1) / ((x-1) *(x+1) *(x^2+1) *(x^2+x-1) *(x^4-2*x^3+x^2-2*x+1)).

A188981 T(n,k)=Number of nXk array permutations with each element moved but moved no more than a city block distance of two.

Original entry on oeis.org

0, 1, 1, 2, 9, 2, 4, 116, 116, 4, 6, 900, 7264, 900, 6, 13, 7836, 295264, 295264, 7836, 13, 24, 71865, 12838276, 54113236, 12838276, 71865, 24, 45, 640513, 577290185, 10523263424, 10523263424, 577290185, 640513, 45, 84, 5706113, 25631148992
Offset: 1

Views

Author

R. H. Hardin Apr 14 2011

Keywords

Comments

Table starts
...0........1.............2...............4................6...............13
...1........9...........116.............900.............7836............71865
...2......116..........7264..........295264.........12838276........577290185
...4......900........295264........54113236......10523263424....2184414516364
...6.....7836......12838276.....10523263424....9562891914304.9298230791255360
..13....71865.....577290185...2184414516364.9298230791255360
..24...640513...25631148992.446454227170968
..45..5706113.1136766429824
..84.51056136
.160

Examples

			Some solutions for 5X3
..1..0..4....1..0..4....1..0..4....1..0..4....1..0..4....1..0..4....1..0..4
..6..2.11....5..6..7....6..8..2....6..8..2....5..3.11....6..5..8....5..2..3
.12..3..5...12..3..2....3.11.14...12..9..5....8.10..2....9..3..2....8.10.14
.13..9..7...11.13..9...13.12..5....3..7.10...13..7..9...10.14..7...11..6.13
.14.10..8...14.10..8....9..7.10...14.11.13....6.14.12...13.12.11....9..7.12
		

Crossrefs

Column 1 is A033305

A376743 Number of permutations (p(1),p(2),...,p(n)) of (1,2,...,n) such that p(i)-i is in {-2,-1,4} for all i=1,...,n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 5, 5, 6, 8, 11, 15, 25, 35, 46, 61, 85, 125, 175, 245, 341, 470, 650, 925, 1300, 1810, 2521, 3520, 4915, 6880, 9640, 13476, 18801, 26251, 36721, 51346, 71776, 100335, 140210, 195886, 273813, 382821, 535105, 747850, 1045220
Offset: 0

Views

Author

Michael A. Allen, Oct 03 2024

Keywords

Comments

Other sequences related to strongly restricted permutations pi(i) of i in {1,..,n} along with the sets of allowed p(i)-i (containing at least 3 elements): A000045 {-1,0,1}, A189593 {-1,0,2,3,4,5,6}, A189600 {-1,0,2,3,4,5,6,7}, A006498 {-2,0,2}, A080013 {-2,1,2}, A080014 {-2,0,1,2}, A033305 {-2,-1,1,2}, A002524 {-2,-1,0,1,2}, A080000 {-2,0,3}, A080001 {-2,1,3}, A080004 {-2,0,1,3}, A080002 {-2,2,3}, A080005 {-2,0,2,3}, A080008 {-2,1,2,3}, A080011 {-2,0,1,2,3}, A079999 {-2,-1,3}, A080003 {-2,-1,0,3}, A080006 {-2,-1,1,3}, A080009 {-2,-1,0,1,3}, A080007 {-2,-1,2,3}, A080010 {-2,-1,0,2,3}, A080012 {-2,-1,1,2,3}, A072827 {-2,-1,0,1,2,3}, A224809 {-2,0,4}, A189585 {-2,0,1,3,4}, A189581 {-2,-1,0,3,4}, A072850 {-2,-1,0,1,2,3,4}, A189587 {-2,0,1,3,4,5}, A189588 {-2,-1,0,3,4,5}, A189594 {-2,0,1,3,4,5,6}, A189595 {-2,-1,0,3,4,5,6}, A189601 {-2,0,1,3,4,5,6,7}, A189602 {-2,-1,0,3,4,5,6,7}, A224811 {-2,0,8}, A224812 {-2,0,10}, A224813 {-2,0,12}, A006500 {-3,0,3}, A079981 {-3,1,3}, A079983 {-3,0,1,3}, A079982 {-3,2,3}, A079984 {-3,0,2,3}, A079988 {-3,1,2,3}, A079989 {-3,0,1,2,3}, A079986 {-3,-1,1,3}, A079992 {-3,-1,0,1,3}, A079987 {-3,-1,2,3}, A079990 {-3,-1,0,2,3}, A079993 {-3,-1,1,2,3}, A079985 {-3,-2,2,3}, A079991 {-3,-2,0,2,3}, A079996 {-3,-2,0,1,2,3}, A079994 {-3,-2,1,2,3}, A079997 {-3,-2, -1,1,2,3}, A002526 {-3,-2,-1,0,1,2,3}, A189586 {-3,0,1,2,4}, A189583 {-3,-1,0,2,4}, A189582 {-3,-2,0,1,4}, A189584 {-3,-2,-1,0,4}, A189589 {-3,0,1,2,4,5}, A189590 {-3,-1,0,2,4,5}, A189591 {-3,-2,1,4,5}, A189592 {-3,-2,-1,0,4,5}, A224810 {-3,0,6}, A189596 {-3,0,1,2,4,5,6}, A189597 {-3,-1,0,2,4,5,6}, A189598 {-3,-2,0,1,4,5,6}, A189599 {-3,-2,-1,0,4,5,6}, A224814 {-3,0,9}, A031923 {-4,0,4}, A072856 {-4,-3, -2,-1,0,1,2,3,4}, A224815 {-4,0,8}, A154654 {-5,-4,-3,-2,-1,0,1,2,3,4,5}, A154655 {-6,-5,-4,-3, -2,-1,0,1,2,3,4,5,6}.
[Keyword "less", because this comment should be moved to the Index to the OEIS, it is not appropriate here. - N. J. A. Sloane, Oct 25 2024]

References

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

Crossrefs

See comments for other sequences related to strongly restricted permutations.

Programs

  • Mathematica
    CoefficientList[Series[(1 - x^3 - x^4 - x^6 + x^9)/(1 - x^3 - x^4 - x^5 - 2*x^6 - x^7 + 2*x^9 + 2*x^10 + x^12 - x^15),{x,0,49}],x]
    LinearRecurrence[{0, 0, 1, 1, 1, 2, 1, 0, -2, -2, 0, -1, 0, 0, 1}, {1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 5, 5, 6, 8}, 50]

Formula

a(n) = a(n-3) + a(n-4) + a(n-5) + 2*a(n-6) + a(n-7) - 2*a(n-9) - 2*a(n-10) - a(n-12) + a(n-15).
G.f.: (1 - x^3 - x^4 - x^6 + x^9)/(1 - x^3 - x^4 - x^5 - 2*x^6 - x^7 + 2*x^9 + 2*x^10 + x^12 - x^15).

A183324 Number of nX3 binary arrays with each 1 adjacent to exactly two other 1s.

Original entry on oeis.org

1, 3, 6, 10, 19, 37, 69, 129, 244, 460, 865, 1629, 3069, 5779, 10882, 20494, 38595, 72681, 136873, 257761, 485416, 914136, 1721505, 3241945, 6105241, 11497411, 21651966, 40775058, 76787731, 144606925, 272324269, 512842017, 965785884
Offset: 1

Views

Author

R. H. Hardin Jan 03 2011

Keywords

Comments

Column 3 of A183328

Examples

			All solutions for 4X3
..0..0..0....0..0..0....1..1..1....0..0..0....0..0..0....0..0..0....1..1..0
..0..0..0....0..0..0....1..0..1....1..1..1....0..1..1....1..1..0....1..1..0
..1..1..0....0..0..0....1..0..1....1..0..1....0..1..1....1..1..0....0..0..0
..1..1..0....0..0..0....1..1..1....1..1..1....0..0..0....0..0..0....0..0..0
...
..0..0..0....0..1..1....1..1..1
..0..0..0....0..1..1....1..0..1
..0..1..1....0..0..0....1..1..1
..0..1..1....0..0..0....0..0..0
		

Formula

Empirical: a(n)=2*a(n-1)-a(n-2)+2*a(n-3)-a(n-4).
Empirical: G.f. -x*(-1-x+x^3-x^2) / ( 1-2*x+x^2-2*x^3+x^4 ), see A033305 - R. J. Mathar, Sep 27 2013

A321048 Number of permutations of [n] with no fixed points where the maximal displacement of an element equals two.

Original entry on oeis.org

0, 2, 3, 6, 12, 24, 44, 84, 159, 300, 564, 1064, 2004, 3774, 7107, 13386, 25208, 47472, 89400, 168360, 317055, 597080, 1124424, 2117520, 3987720, 7509690, 14142275, 26632782, 50154948, 94451976, 177872292, 334969724, 630816159, 1187955204, 2237161404
Offset: 2

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=2 of A259784.

Formula

G.f.: (x-2)*x^3/((x-1)*(x+1)*(x^4-2*x^3+x^2-2*x+1)).
a(n) = A033305(n) - A059841(n).
a(n) = 2*a(n-1) - 2*a(n-5) + a(n-6). - Wesley Ivan Hurt, May 17 2023

A321049 Number of permutations of [n] with no fixed points where the maximal displacement of an element equals three.

Original entry on oeis.org

0, 5, 18, 44, 116, 331, 932, 2532, 6720, 17804, 47280, 125460, 331736, 874973, 2305750, 6075184, 16001968, 42130767, 110885496, 291792264, 767776064, 2020061968, 5314529928, 13981117152, 36779372688, 96751538581, 254510051546, 669494097852, 1761102380100
Offset: 3

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=3 of A259784.

Formula

G.f.: (x^10-x^9-2*x^8+3*x^7-x^6+2*x^5-7*x^4+x^3+10*x^2-3*x-5) * x^4 / ((x+1) *(x^4-2*x^3+x^2-2*x+1) *(x^13-x^11+x^10-x^9-x^8-9*x^7-3*x^6+3*x^5+7*x^4-x^3+x^2+2*x-1)).
a(n) = A079997(n) - A033305(n).
Showing 1-7 of 7 results.