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-6 of 6 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).

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

Original entry on oeis.org

1, 0, 1, 2, 9, 44, 265, 1854, 4752, 12072, 30500, 76038, 190656, 481318, 1224852, 3117528, 7944464, 20283046, 51912320, 133129054, 341972624, 879678624, 2266157892, 5846150862, 15101728320, 39058470566, 101135401556, 262158219552, 680253580304, 1766843951390
Offset: 0

Views

Author

Alois P. Heinz, Jul 15 2015

Keywords

Comments

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

Examples

			a(8) = 4752: 21436587, 21436785, 21436857, 21437586, ..., 87653421, 87654123, 87654312, 87654321.
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=0, 1, LinearAlgebra[Permanent](Matrix(n, (i, j)->
            `if`(i<>j and (i-j mod n<=3 or j-i mod n<=3), 1, 0)))):
    seq(a(n), n=0..15);
  • Mathematica
    a[n_] := If[n == 0, 1, Permanent[Table[If[i != j && (Mod[i - j, n] <= 3 || Mod[j - i, n] <= 3), 1, 0], {i, 1, n}, {j, 1, n}]]]; Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Jan 06 2016, adapted from Maple *)

Formula

G.f.: -(631*x^43 +953*x^42 -174*x^41 -3296*x^40 -6097*x^39 -3581*x^38 -11543*x^37 -14483*x^36 +3789*x^35 +67487*x^34 +120551*x^33 +88025*x^32 +64863*x^31 +14567*x^30 -69173*x^29 -386577*x^28 -600146*x^27 -488818*x^26 -105459*x^25 +188333*x^24 +315070*x^23 +540030*x^22 +633950*x^21 +478098*x^20 +53481*x^19 -202345*x^18 -260532*x^17 -228778*x^16 -157245*x^15 -78737*x^14 +1943*x^13 +17159*x^12 +13669*x^11 +7299*x^10 +3547*x^9 +981*x^8 -1103*x^7 -151*x^6 -25*x^5 -5*x^4 +3*x -1) / ((x-1) *(x+1) *(x^2+x+1) *(x^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) *(x^3+x^2+x-1) *(x^3-x^2-x-1) *(x^12+x^11+x^10-x^8+x^7-8*x^6-7*x^5-5*x^4-2*x^3-x^2-x+1)).

A188966 T(n,k)=Number of nXk array permutations with each element moved and moved by a city block distance of no more than three.

Original entry on oeis.org

0, 1, 1, 2, 9, 2, 9, 265, 265, 9, 24, 8132, 78976, 8132, 24, 57, 154564, 22666641, 22666641, 154564, 57, 140, 2790864, 4064659324, 62394485617, 4064659324, 2790864, 140, 376, 55327556, 741295637637, 109564294856817, 109564294856817
Offset: 1

Views

Author

R. H. Hardin Apr 14 2011

Keywords

Comments

Table starts
...0........1............2...............9..............24...........57
...1........9..........265............8132..........154564......2790864
...2......265........78976........22666641......4064659324.741295637637
...9.....8132.....22666641.....62394485617.109564294856817
..24...154564...4064659324.109564294856817
..57..2790864.741295637637
.140.55327556
.376

Examples

			Some solutions for 5X3
..1..0..3....1..0..3....1..0..3....1..0..3....1..0..3....1..0..3....1..0..3
..2..7..6....2..7..8....2..7..6....2..7..8....2..7..8....2..7..8....2..7..8
..8..5.13....4.14.10....8.14..5....9..6..5...12..4.13....4..9.13....5.10..4
.14.12..4...13..5..6...13.11..4...13.14..4....6..9.14...11.14..5...12..9..6
.10..9.11....9.11.12...10.12..9...10.12.11...11.10..5...10..6.12...11.14.13
		

Crossrefs

Column 1 is A079997

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).

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).

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

Original entry on oeis.org

0, 20, 111, 396, 1285, 4312, 15437, 55572, 196288, 678270, 2311191, 7856610, 26732463, 90996552, 309390463, 1049670138, 3554983881, 12027825752, 40676758809, 137534141216, 464908099716, 1571078027012, 5307751810223, 17928124690902, 60548310641344
Offset: 4

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=4 of A259784.

Formula

a(n) = A259777(n) - A079997(n).
Showing 1-6 of 6 results.