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 12 results. Next

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

A259834 Number of permutations of [n] with no fixed points where the maximal displacement of an element equals n-1.

Original entry on oeis.org

0, 0, 1, 2, 5, 20, 97, 574, 3973, 31520, 281825, 2803418, 30704101, 367114252, 4757800705, 66432995030, 994204132517, 15875195019224, 269397248811073, 4841453414347570, 91856764780324165, 1834779993945449348, 38485629141294791201, 845788826477292504302
Offset: 0

Views

Author

Alois P. Heinz, Jul 06 2015

Keywords

Comments

a(n) counts permutations p of [n] such that p(i) <> i and (p(1) = n or p(n) = 1).

Examples

			a(2) = 1: 21.
a(3) = 2: 231, 312.
a(4) = 5: 2341, 3421, 4123, 4312, 4321.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, [0, 0, 1][n+1],
         ((2*n^2-11*n+13)*a(n-1) +(2*n-5)*(n-3)*a(n-2))/(2*n-7))
        end:
    seq(a(n), n=0..30);
  • Mathematica
    Join[{0, 0}, Table[DifferenceRoot[Function[{y, m}, {y[1 + m] == (n - m)*y[m] + (n - m) y[m - 1], y[0] == 0, y[1] == 1, y[2] == 1}]][n], {n, 2, 30}]] (* Benedict W. J. Irwin, Nov 03 2016 *)
    Table[If[n<2, 0, Subfactorial[n-2]+2*Subfactorial[n-1]], {n,0,23}] (* Peter Luschny, Oct 04 2017 *)
  • Python
    def A259834_list(len):
        L, u, x, y = [0], 1, 0, 0
        for n in range(len):
            y, x, u = x, x*n + u, -u
            L.append(y + 2*x)
        L[1] = 0
        return L
    print(A259834_list(23)) # Peter Luschny, Oct 04 2017

Formula

a(n) = ((2*n^2-11*n+13)*a(n-1) + (2*n-5)*(n-3)*a(n-2))/(2*n-7) for n > 2.
a(n) = (n-2)! * [x^(n-2)] exp(-x)*(x+1)/(x-1)^2 for n > 1.
a(n) ~ 2 * (n-1)! / exp(1). - Vaclav Kotesovec, Jul 07 2015
a(n) = y(n,n), n > 1, where y(m+1,n) = (n-m)*y(m,n) + (n-m)*y(m-1,n), with y(0,n)=0, y(1,n)=y(2,n)=1 for all n. - Benedict W. J. Irwin, Nov 03 2016
From Peter Luschny, Oct 05 2017: (Start)
a(n) = (Gamma(n-1, -1) + 2*Gamma(n, -1)) / e for n >= 2.
a(n) = A000166(n-2) + 2*A000166(n-1) for n >= 2.
a(n) = (2*n-1)*A000166(n-2) - 2*(-1)^n for n >= 2.
a(n) = A000255(n-2) + A000166(n-1) for n >= 2.
a(n+2) = (-1)^n*(-hypergeom([1,1-n], [], 1) + hypergeom([2,2-n], [], 1)) = A292898(2, n) for n >= 0.
a(n) ~ 2*sqrt(2*Pi)*exp(-n-1)*n^(n-1/2). (End)
a(n+2) = A306455(n) + n! for n >= 0. - Alois P. Heinz, Feb 16 2019

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

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

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

Original entry on oeis.org

0, 97, 744, 3628, 15038, 59963, 245386, 1054116, 4585666, 19816317, 84377528, 354143757, 1472404694, 6105113905, 25314316974, 105009933736, 435538239600, 1804712603943, 7467462109856, 30859243303779, 127410491972804, 525761755401512, 2168906840165128
Offset: 5

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=5 of A259784.

Formula

a(n) = A259778(n) - A259777(n).

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

Original entry on oeis.org

0, 574, 5571, 34948, 181193, 870934, 4113244, 19845700, 99472963, 505871096, 2572439079, 12975021278, 64715221044, 319501249574, 1566516774344, 7660714576044, 37445731303872, 183081927465284, 895275467752721, 4376669424005308, 21379883128454905
Offset: 6

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=6 of A259784.

Formula

a(n) = A259779(n) - A259778(n).

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

Original entry on oeis.org

0, 3973, 46662, 359724, 2270840, 12994207, 71401928, 389384029, 2162806868, 12393816965, 72063175820, 420431229772, 2443816138204, 14098735154983, 80635213447724, 457661900843292, 2583741730021382, 14552232847553984, 81904772313605164, 461011600699499344
Offset: 7

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=7 of A259784.

Formula

a(n) = A259780(n) - A259779(n).

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

Original entry on oeis.org

0, 31520, 434127, 3979676, 29836261, 200251036, 1269799244, 7866814026, 48627012403, 305484315674, 1970229533360, 12885942393622, 84719993481585, 556551975117208, 3639388789709545, 23644099935731588, 152553455368658432, 978410935801325180, 6248373677853677799
Offset: 8

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=8 of A259784.

Formula

a(n) = A259781(n) - A259780(n).

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

Original entry on oeis.org

0, 281825, 4451724, 47355884, 412882090, 3202361483, 23212224128, 162423570785, 1121100331330, 7743988554848, 54274875428464, 389110611485999, 2826724445254744, 20662487594362983, 151199827593760314, 1103728723985787116, 8020129818824497034
Offset: 9

Views

Author

Alois P. Heinz, Oct 26 2018

Keywords

Crossrefs

Column k=9 of A259784.

Formula

a(n) = A259782(n) - A259781(n).
Showing 1-10 of 12 results. Next