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-10 of 14 results. Next

A002524 Number of permutations of length n within distance 2 of a fixed permutation.

Original entry on oeis.org

1, 1, 2, 6, 14, 31, 73, 172, 400, 932, 2177, 5081, 11854, 27662, 64554, 150639, 351521, 820296, 1914208, 4466904, 10423761, 24324417, 56762346, 132458006, 309097942, 721296815, 1683185225, 3927803988, 9165743600, 21388759708, 49911830577, 116471963129
Offset: 0

Views

Author

Keywords

Comments

From Torleiv Kløve, Jan 09 2009: (Start)
Let V(d,n) be the number of permutations of length n within distance d of a fixed permutation. For d=1,2,3,4,...,10 these are A000045, A002524, A002526, A072856, A154654, A154655, A154656, A154657, A154658, A154659. The generating function is a rational function f_d(z)/g_d(z) (see the Kløve report referenced here). For d<=6, deg g_d = 2^{d-1} + binomial(2*d,d)/2 and deg f_d(z) = deg g_d(z)-2d. As a table:
d deg g_d deg f_d
1 2 0
2 5 1
3 14 8
4 43 35
5 142 132
6 494 482
(End)
For positive n, a(n) equals the permanent of the n X n matrix with 1's along the five central diagonals, and 0's everywhere else. - John M. Campbell, Jul 09 2011

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, 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).
  • R. P. Stanley, Enumerative Combinatorics I, Example 4.7.16, p. 253.

Crossrefs

Column k=2 of A306209.

Programs

  • Magma
    I:=[1,1,2,6,14]; [n le 5 select I[n] else 2*Self(n-1) +2*Self(n-3) -Self(n-5): n in [1..41]]; // G. C. Greubel, Jan 21 2022
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2*x-2*x^3+x^5), {x,0,50}], x] (* Vladimir Joseph Stephan Orlovsky, Jun 24 2011 *)
  • PARI
    a(n)=if(n,([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; -1,0,2,0,2]^n*[1;1;2;6;14])[1,1],1) \\ Charles R Greathouse IV, Jul 28 2015
    
  • Sage
    [( (1-x)/(1-2*x-2*x^3+x^5) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 21 2022

Formula

G.f.: (1-x)/(1-2*x-2*x^3+x^5). - Simon Plouffe in his 1992 dissertation.

Extensions

Typo in comment corrected by Vaclav Kotesovec, Dec 01 2012

A072856 Number of permutations satisfying i-4<=p(i)<=i+4, i=1..n (permutations of length n within distance 4).

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 504, 1902, 6902, 25231, 95401, 365116, 1396948, 5316192, 20135712, 76227216, 288878956, 1095937420, 4159450913, 15783649241, 59878012558, 227128287882, 861543171080, 3268198646496, 12398132725784, 47033439463906, 178423731589482
Offset: 0

Views

Author

Vladimir Baltic, Jul 25 2002

Keywords

Comments

a(n) equals the permanent of the n X n matrix with 1's along the nine central diagonals and 0's everywhere else. - John M. Campbell, Jul 09 2011

Crossrefs

Formula

G.f.: (1 -2*x -3*x^2 -x^3 +4*x^4 -31*x^5 -5*x^6 +32*x^7 -21*x^8 +129*x^9 +94*x^10 -83*x^11 +11*x^12 -192*x^13 -59*x^14 +63*x^15 -16*x^16 +3*x^17 -29*x^18 -46*x^19 -57*x^20 +253*x^21 -28*x^22 -101*x^23 +17*x^24 +104*x^25 -15*x^26 -29*x^27 +10*x^28 -x^29 +x^30 -x^32 -3*x^33 +x^35) / (1 -3*x -2*x^2 +x^3 +x^4 -70*x^5 -39*x^6 +31*x^7 +114*x^8 +522*x^9 +184*x^10 -34*x^11 -46*x^12 -1444*x^13 -202*x^14 +606*x^15 -1204*x^16 -198*x^17 +804*x^18 -542*x^19 +26*x^20 +2372*x^21 +318*x^22 -1582*x^23 +328*x^24 +2018*x^25 +222*x^26 -810*x^27 -184*x^28 +706*x^29 +14*x^30 -204*x^31 -70*x^32 -14*x^33 -28*x^34 +22*x^35 +11*x^36 -47*x^37 +8*x^38 +11*x^39 +x^40 +4*x^41 -x^42 -x^43). - Torleiv Kløve, Jan 13 2009; corrected by Colin Barker, Jul 06 2013

Extensions

a(0)=1 prepended and more terms added by Colin Barker, Jul 06 2013

A001564 2nd differences of factorial numbers.

Original entry on oeis.org

1, 3, 14, 78, 504, 3720, 30960, 287280, 2943360, 33022080, 402796800, 5308934400, 75203251200, 1139544806400, 18394619443200, 315149522688000, 5711921639424000, 109196040425472000, 2196014181064704000, 46346783255764992000, 1024251745442365440000
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the number of isolated fixed points (i.e. adjacent fixed points are not isolated) in all permutations of [n+2]. Example: a(2)=14 because we have (the isolated fixed points are marked) 1'423, 1'324', 1'342, 1'43'2, 413'2, 3124', 42'13, 2314', 243'1, 32'14', 32'41. - Emeric Deutsch, Apr 18 2009
The average of the first n terms is n factorial. - Franklin T. Adams-Watters, May 20 2010
Number of blocks in all permutations of [n+1]. A block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions. For example, the permutation 5412367 has 4 blocks: 5, 4, 123, and 67. Example: a(2)=14 because the permutations of [3], separated into blocks, are 123, 1-3-2, 2-1-3, 23-1, 3-12, 3-2-1 with 1+3+3+2+2+3=14 blocks. - Emeric Deutsch, Jul 12 2010
a(n) equals n+1 times the permanent of the (n+1) X (n+1) matrix with 1/(n+1) in the top right corner and 1's everywhere else. - John M. Campbell, May 25 2011
Number of permutations s of [n+2] where 2 designated elements are not mapped to themselves, e.g., s(1) != 1 and s(2) != 2. See Janjić article. - Benjamin Schreyer, May 07 2025

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

Programs

  • Magma
    [(n^2+n+1)*Factorial(n): n in [0..20]]; // Vincenzo Librandi, Apr 10 2015
  • Maple
    seq(factorial(n)*(n^2+n+1), n = 0 .. 20); # Emeric Deutsch, Apr 18 2009
  • Mathematica
    Range[0,20]! CoefficientList[Series[(1+x^2)/(1-x)^3,{x,0,20}],x]
    Differences[Range[0, 25]!, 2] (* Paolo Xausa, Jul 17 2025 *)
  • PARI
    Vec(serlaplace((1+x^2)/(1-x)^3 + O(x^30))) \\ Michel Marcus, Apr 10 2015
    

Formula

a(n) = (n^2 + n + 1)*n! = A002061(n-1)*A000142(n). - Mitch Harris, Jul 10 2008
E.g.f.: (1+x^2)/(1-x)^3.
a(n) = A001563(n+1) - A001563(n). - Robert Israel, Apr 13 2015
a(n) = A306209(n+2,n). - Alois P. Heinz, Jan 29 2019
D-finite with recurrence a(n) +(-n-3)*a(n-1) +(n-1)*a(n-2)=0. - R. J. Mathar, Jul 01 2022

Extensions

Comment edited by Franklin T. Adams-Watters, May 20 2010

A002526 Number of permutations of length n within distance 3 of a fixed permutation.

Original entry on oeis.org

1, 1, 2, 6, 24, 78, 230, 675, 2069, 6404, 19708, 60216, 183988, 563172, 1725349, 5284109, 16177694, 49526506, 151635752, 464286962, 1421566698, 4352505527, 13326304313, 40802053896, 124926806216, 382497958000, 1171122069784, 3585709284968, 10978628154457
Offset: 0

Views

Author

Keywords

Comments

For positive n, a(n) equals the permanent of the n X n matrix with 1's along the seven central diagonals, and 0's everywhere else. - John M. Campbell, Jul 09 2011

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, 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

The 14 sequences in Kløve's Table 3 are A002526, A002527, A002529, A188379, A188491, A188492, A188493, A188494, A002528, A188495, A188496, A188497, A188498, A002526.
Cf. A002524.
Column k=3 of A306209.

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14) )); // G. C. Greubel, Jan 22 2022
    
  • Mathematica
    CoefficientList[Series[(1-x-2x^2-2x^4+x^7+x^8)/(1-2x-2x^2-10x^4-8x^5+ 2x^6+ 16x^7+10x^8+2x^9-4x^10-2x^11-2x^13-x^14),{x,0,50}],x] (* or *) LinearRecurrence[{2,2,0,10,8,-2,-16,-10,-2,4,2,0,2,1},{1,1,2,6,24,78, 230, 675,2069,6404,19708,60216,183988,563172},51] (* Harvey P. Dale, Jun 22 2011 *)
  • PARI
    Vec((1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8+2*x^9-4*x^10-2*x^11-2*x^13-x^14)+O(x^99)) \\ Charles R Greathouse IV, Jul 16 2011
    
  • Sage
    [( (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 22 2022

Formula

G.f.: (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14).
a(0)=1, a(1)=1, a(2)=2, a(3)=6, a(4)=24, a(5)=78, a(6)=230, a(7)=675, a(8)=2069, a(9)=6404, a(10)=19708, a(11)=60216, a(12)=183988, a(13)=563172, a(n) = 2*a(n-1) +2*a(n-2) +10*a(n-4) +8*a(n-5) -2*a(n-6) -16*a(n-7) -10*a(n-8) -2*a(n-9) +4*a(n-10) +2*a(n-11) +2*a(n-13) +a(n-14). - Harvey P. Dale, Jun 22 2011

A092552 Let X_{m,n}(q) be the chromatic polynomial of the complete bipartite graph K_{m,n}. Then a(n) is the negative of the coefficient of the linear term of X_{n,n}(q).

Original entry on oeis.org

0, 1, 3, 31, 675, 25231, 1441923, 116914351, 12764590275, 1805409270031, 321113303226243, 70146437009397871, 18462286083671614275, 5762225835975165678031, 2104263061425865873128963, 888881838896989670838028591, 430058409024841744606172532675
Offset: 0

Views

Author

Michael Lugo (mtlugo(AT)mit.edu), Apr 09 2004

Keywords

Comments

From Arvind Ayyer, Oct 25 2020: (Start)
Equivalently, a(n) is the number of acyclic orientations with a unique sink in K_{n,n}.
a(n) is also the number of toppleable permutations in S_{2n-1}. A toppleable permutation pi in S_{2n-1} satisfies pi_i <= n-1+i for 1 <= i <= n-1 and pi_i >= i-n+1 for n <= i <= 2n-1. The a(3)=3 toppleable permutations in S_3 are 123, 213 and 132. (End)

Examples

			a(2) = 3 since the chromatic polynomial of K_{2,2}(q) is q^4-4*q^3+6*q^2-3*q.
E.g.f.: A(x) = x + 3*x^2/2! + 31*x^3/3! + 675*x^4/4! + 25231*x^5/5! +...
where A(x) = (1-exp(-x)) + (1-exp(-2*x))^2/2 + (1-exp(-3*x))^3/3 +... - _Paul D. Hanna_, Dec 06 2012
O.g.f.: F(x) = x + 3*x^2 + 31*x^3 + 675*x^4 + 25231*x^5 +...
where F(x) = x/(1+x) + 2^1*2!*x^2/((1+2*1*x)*(1+2*2*x)) + 3^2*3!*x^3/((1+3*1*x)*(1+3*2*x)*(1+3*3*x)) + 4^3*4!*x^4/((1+4*1*x)*(1+4*2*x)*(1+4*3*x)*(1+4*4*x)) +... - _Paul D. Hanna_, Jan 05 2013
		

Crossrefs

Programs

  • Maple
    a:= n-> -coeff(add(Stirling2(n, k) *mul(q-i, i=0..k-1)
                 *(q-k)^n, k=1..n), q, 1):
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 30 2012
  • Mathematica
    Table[Sum[k!*(k-1)!*StirlingS2[n,k]^2,{k,1,n}],{n,0,20}] (* Vaclav Kotesovec, Jun 21 2013 *)
  • PARI
    {a(n)=n!*polcoeff(sum(k=1,n,(1-exp(-k*x+x*O(x^n)))^k/k),n)} \\ Paul D. Hanna, Dec 06 2012
    for(n=0,20,print1(a(n),", "))
    
  • PARI
    {Stirling2(n, k)=n!*polcoeff(((exp(x+x*O(x^n))-1)^k)/k!, n)}
    {a(n)=if(n<=0, 0, sum(k=1, n, k!*(k-1)! * Stirling2(n, k)^2))} \\ Paul D. Hanna, Dec 30 2012
    for(n=0, 20, print1(a(n), ", "))
    
  • PARI
    {a(n)=if(n<1,0,polcoeff(sum(m=1, n, m^(m-1)*m!*x^m/prod(k=1, m, 1+m*k*x+x*O(x^n))), n))} \\ Paul D. Hanna, Jan 05 2013

Formula

From Alois P. Heinz, Apr 30 2012: (Start)
a(n) = (-1) * [q] Sum_{j=1..n} (q-j)^n*S2(n,j)*Product_{i=0..j-1} (q-i).
a(n) = (-1) * A212084(n,2n-1). (End)
E.g.f.: Sum_{n>=1} (1 - exp(-n*x))^n / n. - Paul D. Hanna, Dec 06 2012
a(n) = Sum_{k=1..n} k!*(k-1)! * Stirling2(n, k)^2. - Paul D. Hanna, Dec 30 2012, corrected by Vaclav Kotesovec, Jun 21 2013
O.g.f.: Sum_{n>=1} n^(n-1) * n! * x^n / Product_{k=1..n} (1 + n*k*x). - Paul D. Hanna, Jan 05 2013
a(n) = A136126(2*n-1,n), where triangle A136126(n,k) is the number of permutations of {1,2,...,k+n} having excedance set {1,2,...,k}. - Paul D. Hanna, Feb 01 2013
a(n) ~ sqrt(Pi) * n^(2*n-1/2) / (sqrt(1-log(2)) * exp(2*n) * (log(2))^(2*n)). - Vaclav Kotesovec, Nov 07 2014
a(n) = A306209(2n-1,n-1) for n > 0. - Alois P. Heinz, Feb 01 2019

A048163 a(n) = Sum_{k=1..n} ((k-1)!)^2*Stirling2(n,k)^2.

Original entry on oeis.org

1, 2, 14, 230, 6902, 329462, 22934774, 2193664790, 276054834902, 44222780245622, 8787513806478134, 2121181056663291350, 611373265185174628502, 207391326125004608457782, 81791647413265571604175094, 37109390748309009878392597910, 19192672725746588045912535407702
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of max-closed relations on an ordered n-element domain (see the paper by Jeavons and Cooper, 1995). - Don Knuth, Feb 12 2024

Examples

			1
1 + 1 = 2
1 + 9 + 4 = 14
1 + 49 + 144 + 36 = 230
1 + 225 + 2500 + 3600 + 576 = 6902
... - _Philippe Deléham_, May 30 2015
		

References

  • Lovasz, L. and Vesztergombi, K.; Restricted permutations and Stirling numbers. Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), Vol. II, pp. 731-738, Colloq. Math. Soc. Janos Bolyai, 18, North-Holland, Amsterdam-New York, 1978.
  • K. Vesztergombi, Permutations with restriction of middle strength, Stud. Sci. Math. Hungar., 9 (1974), 181-185.

Crossrefs

Main diagonal of array A099594.

Programs

  • Mathematica
    Table[Sum[((k-1)!)^2*StirlingS2[n,k]^2,{k,1,n}],{n,1,20}] (* Vaclav Kotesovec, Jun 21 2013 *)
  • PARI
    a(n)=if(n<1, 0, polcoeff(sum(m=1, n, m^(m-1)*(m-1)!*x^m/prod(k=1, m-1, 1+m*k*x+x*O(x^n))), n)) \\ Paul D. Hanna, Jan 05 2013
    for(n=1,20,print1(a(n),", "))
    
  • PARI
    Stirling2(n, k)=n!*polcoeff(((exp(x+x*O(x^n))-1)^k)/k!, n)
    a(n)=sum(k=1,n,(-1)^(n-k)*k^(n-1)*(k-1)!*Stirling2(n-1, k-1))
    for(n=1, 20, print1(a(n), ", ")) \\ Paul D. Hanna, Jan 06 2013
    
  • PARI
    a(n) = sum(k=1, n, (k-1)!^2*stirling(n,k,2)^2); \\ Michel Marcus, Jun 22 2018

Formula

E.g.f. (with offset 0): Sum((1-exp(-(m+1)*z))^m, m=0..oo)
O.g.f.: Sum_{n>=1} n^(n-1) * (n-1)! * x^n / Product_{k=1..n-1} (1 - n*k*x). - Paul D. Hanna, Jan 05 2013
Limit n->infinity (a(n)/n!)^(1/n)/n = 1/(exp(1)*(log(2))^2) = 0.7656928576... . - Vaclav Kotesovec, Jun 21 2013
a(n) ~ 2*sqrt(Pi) * n^(2*n-3/2) / (sqrt(1-log(2)) * exp(2*n) * (log(2))^(2*n-1)). - Vaclav Kotesovec, May 13 2014
a(n+1) = Sum_{k = 0..n} A163626(n,k)^2. - Philippe Deléham, May 30 2015
a(n) = A306209(2n-2,n-1). - Alois P. Heinz, Feb 01 2019
a(n) = A266695(2n-2). - Alois P. Heinz, Apr 17 2024

Extensions

Entry revised by N. J. A. Sloane, Jul 05 2012

A130152 Triangle read by rows: T(n,k) = number of permutations p of [n] such that max(|p(i)-i|)=k (n>=1, 0<=k<=n-1).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 4, 9, 10, 1, 7, 23, 47, 42, 1, 12, 60, 157, 274, 216, 1, 20, 151, 503, 1227, 1818, 1320, 1, 33, 366, 1669, 4833, 10402, 13656, 9360, 1, 54, 877, 5472, 18827, 50879, 96090, 115080, 75600, 1, 88, 2088, 17531, 75693, 234061, 569602, 966456, 1077840, 685440, 1, 143, 4937, 55135, 304900, 1076807, 3111243, 6791994, 10553640, 11123280, 6894720
Offset: 1

Views

Author

Emeric Deutsch, May 27 2007

Keywords

Comments

Row sums are the factorials. T(n,n) = (n-2)!*(2n-3) = A007680(n-2) (for n>=2). T(n,1) = Fibonacci(n+1)-1 = A000071(n+1). Sum_{k=0..n-1} k*T(n,k) = A130153(n). For the statistic max(p(i)-i) see A056151.

Examples

			T(4,1) = 4 because we have 1243, 1324, 2134 and 2143.
Triangle starts:
  1;
  1,  1;
  1,  2,  3;
  1,  4,  9,  10;
  1,  7, 23,  47,  42;
  1, 12, 60, 157, 274, 216;
  ...
		

Crossrefs

Row sums give A000142.
T(n,floor(n/2)) gives A323807.

Programs

  • Maple
    with(combinat): for n from 1 to 7 do P:=permute(n): for i from 0 to n-1 do ct[i]:=0 od: for j from 1 to n! do if max(seq(abs(P[j][i]-i),i=1..n))=0 then ct[0]:=ct[0]+1 elif max(seq(abs(P[j][i]-i),i=1..n))=1 then ct[1]:=ct[1]+1 elif max(seq(abs(P[j][i]-i),i=1..n))=2 then ct[2]:=ct[2]+1 elif max(seq(abs(P[j][i]-i),i=1..n))=3 then ct[3]:=ct[3]+1 elif max(seq(abs(P[j][i]-i),i=1..n))=4 then ct[4]:=ct[4]+1 elif max(seq(abs(P[j][i]-i),i=1..n))=5 then ct[5]:=ct[5]+1 elif max(seq(abs(P[j][i]-i),i=1..n))=6 then ct[6]:=ct[6]+1 else fi od: a[n]:=seq(ct[i],i=0..n-1): od: for n from 1 to 7 do a[n] od; # a cumbersome program to obtain, by straightforward counting, the first 7 rows of the triangle
    n := 8: st := proc (p) max(seq(abs(p[j]-j), j = 1 .. nops(p))) end proc: with(combinat): P := permute(n): f := sort(add(t^st(P[i]), i = 1 .. factorial(n))); # program gives the row generating polynomial for the specified n - Emeric Deutsch, Aug 13 2009
    # second Maple program:
    b:= proc(s) option remember; (n-> `if`(n=0, 1, add((p-> add(
          coeff(p, x, i)*x^max(i, abs(n-j)), i=0..degree(p)))(
            b(s minus {j})), j=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b({$1..n})):
    seq(T(n), n=1..10);  # Alois P. Heinz, Jan 21 2019
    # third Maple program:
    A:= proc(n, k) option remember; LinearAlgebra[Permanent](
          Matrix(n, (i, j)-> `if`(abs(i-j)<=k, 1, 0)))
        end:
    T:= (n, k)-> A(n, k)-A(n, k-1):
    seq(seq(T(n, k), k=0..n-1), n=1..10);  # Alois P. Heinz, Jan 22 2019
  • Mathematica
    (* from second Maple program: *)
    b[s_List] := b[s] = Function[n, If[n == 0, 1, Sum[Function[p, Sum[ Coefficient[p, x, i]*x^Max[i, Abs[n - j]], {i, 0, Exponent[p, x]}]][b[s ~Complement~ {j}]], {j, s}]]][Length[s]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n-1}]][b[Range[n]] ];
    Table[T[n], {n, 1, 11}] // Flatten
    (* from third Maple program: *)
    A[n_, k_] := A[n, k] = Permanent[Table[If[Abs[i-j] <= k, 1, 0], {i, 1, n}, {j, 1, n}]];
    T[n_, k_] := A[n, k] - A[n, k - 1];
    Table[Table[T[n, k], {k, 0, n - 1}], {n, 1, 11}] // Flatten (* Jean-François Alcover, Dec 06 2019, after Alois P. Heinz *)

Formula

T(n,k) = A306209(n,k) - A306209(n,k-1) for k > 0, T(n,0) = 1. - Alois P. Heinz, Jan 29 2019

Extensions

More terms from R. J. Mathar, Oct 15 2007

A154654 Number of permutations of length n within distance 5.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 3720, 17304, 76110, 329462, 1441923, 6487445, 29555588, 135025756, 615260976, 2791161792, 12618600768, 57008446080, 257708989200, 1166042944564, 5279435858788, 23908888017477, 108262665958797, 490132089640318, 2218641353956314
Offset: 0

Views

Author

Torleiv Kløve, Jan 13 2009

Keywords

Comments

a(n) equals the permanent of the n X n matrix with 1's along the eleven central diagonals and 0's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Column k=5 of A306209.

Formula

G.f. is a rational function f(x)/g(x) where f has degree 132 and g has degree 142.

Extensions

a(0)=1 prepended by Alois P. Heinz, Jan 28 2019

A154655 Number of permutations of length n within distance 6.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5040, 30960, 172200, 899064, 4553166, 22934774, 116914351, 610093513, 3222826972, 17101449940, 90706002192, 479654768640, 2527274267136, 13280313508416, 69734129749632, 366283822765632, 1925290900630896, 10126754515065868
Offset: 0

Views

Author

Torleiv Kløve, Jan 13 2009

Keywords

Comments

a(n) equals the permanent of the n X n matrix with 1's along the central thirteen diagonals, and 0's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Column k=6 of A306209.

Formula

G.f. is a rational function f(x)/g(x) where f has degree 482 and g has degree 494.

Extensions

a(0)=1 prepended by Alois P. Heinz, Jan 28 2019

A154656 Number of permutations of length n within distance 7.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5040, 40320, 287280, 1865520, 11345160, 66349464, 381523758, 2193664790, 12764590275, 75796724309, 455383613924, 2750869551868, 16635586999056, 100439873614656, 604666567043712, 3629299734118656, 21736009354060800, 130082373922081536
Offset: 0

Views

Author

Torleiv Kløve, Jan 13 2009

Keywords

Comments

a(n) equals the permanent of the n X n matrix with 1's along the central fifteen diagonals, and 0's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Column k=7 of A306209.

Extensions

a(0)=1 prepended by Alois P. Heinz, Jan 28 2019
Showing 1-10 of 14 results. Next