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

A278990 Number of loopless linear chord diagrams with n chords.

Original entry on oeis.org

1, 0, 1, 5, 36, 329, 3655, 47844, 721315, 12310199, 234615096, 4939227215, 113836841041, 2850860253240, 77087063678521, 2238375706930349, 69466733978519340, 2294640596998068569, 80381887628910919255, 2976424482866702081004, 116160936719430292078411
Offset: 0

Views

Author

N. J. A. Sloane, Dec 07 2016

Keywords

Comments

See the signed version of these numbers, A000806, for much more information about these numbers.
From Gus Wiseman, Feb 27 2019: (Start)
Also the number of 2-uniform set partitions of {1..2n} containing no two successive vertices in the same block. For example, the a(3) = 5 set partitions are:
{{1,3},{2,5},{4,6}}
{{1,4},{2,5},{3,6}}
{{1,4},{2,6},{3,5}}
{{1,5},{2,4},{3,6}}
{{1,6},{2,4},{3,5}}
(End)
From Gus Wiseman, Jul 05 2020: (Start)
Also the number of permutations of the multiset {1,1,2,2,...,n,n} with no two consecutive terms equal and where the first i appears before the first j for i < j. For example, the a(3) = 5 permutations are the following.
(1,2,3,1,2,3)
(1,2,3,1,3,2)
(1,2,3,2,1,3)
(1,2,3,2,3,1)
(1,2,1,3,2,3)
(End)

Crossrefs

Column k=0 of A079267.
Column k=2 of A293157.
Row n=2 of A322013.
Cf. A000110, A000699 (topologically connected 2-uniform), A000806, A001147 (2-uniform), A003436 (cyclical version), A005493, A170941, A190823 (distance 3+ version), A322402, A324011, A324172.
Anti-run compositions are A003242.
Separable partitions are A325534.
Other sequences involving the multiset {1,1,2,2,...,n,n}: A001147, A007717, A020555, A094574, A316972.

Programs

  • Magma
    [n le 2 select 2-n else (2*n-3)*Self(n-1) + Self(n-2): n in [1..30]]; // G. C. Greubel, Sep 26 2023
    
  • Mathematica
    RecurrenceTable[{a[n]== (2n-1)a[n-1] +a[n-2], a[0]==1, a[1]==0}, a, {n,0,20}] (* Vaclav Kotesovec, Sep 15 2017 *)
    FullSimplify[Table[-I*(BesselI[1/2+n,-1] BesselK[3/2,1] - BesselI[3/2,-1] BesselK[1/2+ n,1]), {n,0,20}]] (* Vaclav Kotesovec, Sep 15 2017 *)
    Table[(2 n-1)!! Hypergeometric1F1[-n,-2 n,-2], {n,0,20}] (* Eric W. Weisstein, Nov 14 2018 *)
    Table[Sqrt[2/Pi]/E ((-1)^n Pi BesselI[1/2+n,1] +BesselK[1/2+n,1]), {n,0,20}] // FunctionExpand // FullSimplify (* Eric W. Weisstein, Nov 14 2018 *)
    twouniflin[{}]:={{}};twouniflin[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@twouniflin[Complement[set,s]]]/@Table[{i,j},{j,Select[set,#>i+1&]}];
    Table[Length[twouniflin[Range[n]]],{n,0,14,2}] (* Gus Wiseman, Feb 27 2019 *)
  • PARI
    seq(N) = {
      my(a = vector(N)); a[1] = 0; a[2] = 1;
      for (n = 3, N, a[n] = (2*n-1)*a[n-1] + a[n-2]);
      concat(1, a);
    };
    seq(20) \\ Gheorghe Coserea, Dec 09 2016
    
  • SageMath
    def A278990_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( exp(-1+sqrt(1-2*x))/sqrt(1-2*x) ).egf_to_ogf().list()
    A278990_list(30) # G. C. Greubel, Sep 26 2023

Formula

From Gheorghe Coserea, Dec 09 2016: (Start)
D-finite with recurrence a(n) = (2*n-1)*a(n-1) + a(n-2), with a(0) = 1, a(1) = 0.
E.g.f. y satisfies: 0 = (1-2*x)*y'' - 3*y' - y.
a(n) - a(n-1) = A003436(n) for all n >= 2. (End)
From Vaclav Kotesovec, Sep 15 2017: (Start)
a(n) = sqrt(2)*exp(-1)*(BesselK(1/2 + n, 1)/sqrt(Pi) - i*sqrt(Pi)*BesselI(1/2 + n, -1)), where i is the imaginary unit.
a(n) ~ 2^(n+1/2) * n^n / exp(n+1). (End)
a(n) = A114938(n)/n! - Gus Wiseman, Jul 05 2020 (from Alexander Burstein's formula at A114938).
From G. C. Greubel, Sep 26 2023: (Start)
a(n) = (-1)^n * (i/e)*Sqrt(2/Pi) * BesselK(n + 1/2, -1).
G.f.: sqrt(Pi/(2*x)) * exp(-(1+x)^2/(2*x)) * Erfi((1+x)/sqrt(2*x)).
E.g.f.: exp(-1 + sqrt(1-2*x))/sqrt(1-2*x). (End)

Extensions

a(0)=1 prepended by Gheorghe Coserea, Dec 09 2016

A293881 Number T(n,k) of linear chord diagrams having n chords and minimal chord length k (or k=0 if n=0); triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 10, 4, 1, 0, 69, 26, 9, 1, 0, 616, 230, 79, 19, 1, 0, 6740, 2509, 854, 252, 39, 1, 0, 87291, 32422, 11105, 3441, 796, 79, 1, 0, 1305710, 484180, 167273, 52938, 14296, 2468, 159, 1, 0, 22149226, 8203519, 2855096, 919077, 265103, 59520, 7564, 319, 1
Offset: 0

Views

Author

Alois P. Heinz, Oct 18 2017

Keywords

Comments

Conjecture: column k>0 is asymptotic to (exp(-k+1) - exp(-k)) * 2^(n + 1/2) * n^n / exp(n). - Vaclav Kotesovec, Oct 25 2017

Examples

			Triangle T(n,k) begins:
  1;
  0,       1;
  0,       2,      1;
  0,      10,      4,      1;
  0,      69,     26,      9,     1;
  0,     616,    230,     79,    19,     1;
  0,    6740,   2509,    854,   252,    39,    1;
  0,   87291,  32422,  11105,  3441,   796,   79,   1;
  0, 1305710, 484180, 167273, 52938, 14296, 2468, 159,  1;
  ...
		

Crossrefs

Row sums give A001147.
T(2n,n) gives A290688.
Main diagonal and first lower diagonal give: A000012, A054135 (for n>0).

A324428 Number T(n,k) of labeled cyclic chord diagrams with n chords such that every chord has length at least k; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 3, 1, 15, 4, 1, 105, 31, 7, 1, 945, 293, 68, 11, 1, 10395, 3326, 837, 159, 18, 1, 135135, 44189, 11863, 2488, 381, 29, 1, 2027025, 673471, 189503, 43169, 7601, 879, 47, 1, 34459425, 11588884, 3377341, 822113, 160784, 23559, 2049, 76, 1, 654729075, 222304897, 66564396, 17066007, 3621067, 607897, 72989, 4788, 123, 1
Offset: 1

Views

Author

Alois P. Heinz, Feb 27 2019

Keywords

Comments

T(n,k) is defined for all n,k >= 0. The triangle contains only the terms with 1 <= k <= n. T(n,0) = A001147(n), T(0,k) = 1, T(n,k) = 0 for k > n > 0.

Examples

			Triangle T(n,k) begins:
        1;
        3,      1;
       15,      4,      1;
      105,     31,      7,     1;
      945,    293,     68,    11,    1;
    10395,   3326,    837,   159,   18,   1;
   135135,  44189,  11863,  2488,  381,  29,  1;
  2027025, 673471, 189503, 43169, 7601, 879, 47, 1;
  ...
		

Crossrefs

T(n,n-1) gives A000204.

Programs

  • Maple
    b:= proc(n, f, m, l, j) option remember; (k-> `if`(n `if`(n=0 or k<2, doublefactorial(2*n-1),
                  b(2*n-k+1, [1$k-1], 0, [0$k-1], k-1)):
    seq(seq(T(n, k), k=1..n), n=1..10);
  • Mathematica
    b[n_, f_List, m_, l_List, j_] := b[n, f, m, l, j] = Function[k, If[n < Total[f] + m + Total[l], 0, If[n == 0, 1, Sum[If[f[[i]] == 0, 0, b[n - 1, ReplacePart[f, i -> 0], m + l[[1]], Append[ReplacePart[l, 1 -> Nothing], 0], Max[0, j - 1]]],{i, Max[1, j + 1], Min[k, n - 1]}] + If[m == 0, 0, m*b[n - 1, f, m - 1 + l[[1]], Append[ReplacePart[l, 1 -> Nothing], 0], Max[0, j - 1]]] + b[n - 1, f, m + l[[1]], Append[ReplacePart[l, 1 -> Nothing], 1], Max[0, j - 1]]]]][Length[l]];
    T[n_, k_] := If[n == 0 || k < 2, 2^(n-1) Pochhammer[3/2, n-1], b[2n-k+1, Table[1, {k-1}], 0, Table[0, {k-1}], k-1]];
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Apr 27 2020, after Alois P. Heinz *)

Formula

T(n,k) = Sum_{j=k..n} A324429(n,j).

A324429 Number T(n,k) of labeled cyclic chord diagrams having n chords and minimal chord length k (or k=0 if n=0); triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 11, 3, 1, 0, 74, 24, 6, 1, 0, 652, 225, 57, 10, 1, 0, 7069, 2489, 678, 141, 17, 1, 0, 90946, 32326, 9375, 2107, 352, 28, 1, 0, 1353554, 483968, 146334, 35568, 6722, 832, 46, 1, 0, 22870541, 8211543, 2555228, 661329, 137225, 21510, 1973, 75, 1
Offset: 0

Views

Author

Alois P. Heinz, Feb 27 2019

Keywords

Comments

T(n,k) is defined for all n,k >= 0. The triangle contains only the terms with 0 <= k <= n. T(n,k) = 0 for k > n.

Examples

			Triangle T(n,k) begins:
  1;
  0,       1;
  0,       2,      1;
  0,      11,      3,      1;
  0,      74,     24,      6,     1;
  0,     652,    225,     57,    10,    1;
  0,    7069,   2489,    678,   141,   17,   1;
  0,   90946,  32326,   9375,  2107,  352,  28,  1;
  0, 1353554, 483968, 146334, 35568, 6722, 832, 46, 1;
  ...
		

Crossrefs

Row sums give A001147.
Main diagonal gives A000012.
T(n+1,n) gives A001610.

Programs

  • Maple
    b:= proc(n, f, m, l, j) option remember; (k-> `if`(n `if`(n=0 or k<2, doublefactorial(2*n-1),
                  b(2*n-k+1, [1$k-1], 0, [0$k-1], k-1)):
    T:= (n, k)-> `if`(n=k, 1, A(n, k)-A(n, k+1)):
    seq(seq(T(n, k), k=0..n), n=0..10);
  • Mathematica
    b[n_, f_List, m_, l_List, j_] := b[n, f, m, l, j] = Function[k, If[n < Total[f] + m +  Total[l], 0, If[n == 0, 1, Sum[If[f[[i]] == 0, 0, b[n - 1, ReplacePart[f, i -> 0], m + l[[1]], Append[ReplacePart[l, 1 -> Nothing], 0], Max[0, j - 1]]], {i, Max[1, j + 1], Min[k, n - 1]}] + If[m == 0, 0, m*b[n - 1, f, m - 1 + l[[1]], Append[ReplacePart[l, 1 -> Nothing], 0], Max[0, j-1]]] + b[n-1, f, m + l[[1]], Append[ReplacePart[ l, 1 -> Nothing], 1], Max[0, j - 1]]]]][Length[l]];
    A[n_, k_] := If[n == 0 || k < 2, 2^(n-1) Pochhammer[3/2, n-1], b[2n-k+1, Table[1, {k - 1}], 0, Table[0, {k - 1}], k - 1]];
    T[n_, k_] := If[n == k, 1, A[n, k] - A[n, k + 1]];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 27 2020, after Alois P. Heinz *)

Formula

T(n,k) = A324428(n,k) - A324428(n,k+1) for k > 0, T(n,0) = A000007(n).

A190823 Number of permutations of 2 copies of 1..n introduced in order 1..n with no element equal to another within a distance of 2.

Original entry on oeis.org

1, 0, 0, 1, 10, 99, 1146, 15422, 237135, 4106680, 79154927, 1681383864, 39034539488, 983466451011, 26728184505750, 779476074425297, 24281301468714902, 804688068731837874, 28269541494090294129, 1049450257149017422000, 41050171013933837206545
Offset: 0

Views

Author

R. H. Hardin, May 21 2011

Keywords

Comments

From Gus Wiseman, Feb 27 2019: (Start)
Also the number of 2-uniform set partitions of {1..2n} such that no block has its two vertices differing by less than 3. For example, the a(4) = 10 set partitions are:
{{1,4}, {2,6}, {3,7}, {5,8}}
{{1,4}, {2,7}, {3,6}, {5,8}}
{{1,5}, {2,6}, {3,7}, {4,8}}
{{1,5}, {2,6}, {3,8}, {4,7}}
{{1,5}, {2,7}, {3,6}, {4,8}}
{{1,5}, {2,8}, {3,6}, {4,7}}
{{1,6}, {2,5}, {3,7}, {4,8}}
{{1,6}, {2,5}, {3,8}, {4,7}}
{{1,7}, {2,5}, {3,6}, {4,8}}
{{1,8}, {2,5}, {3,6}, {4,7}}
(End)

Examples

			All solutions for n=4 (read downwards):
  1    1    1    1    1    1    1    1    1    1
  2    2    2    2    2    2    2    2    2    2
  3    3    3    3    3    3    3    3    3    3
  4    4    4    4    1    4    4    1    4    4
  1    1    2    1    4    2    1    4    2    2
  3    3    1    2    2    3    2    3    1    3
  2    4    4    4    3    4    3    2    3    1
  4    2    3    3    4    1    4    4    4    4
		

Crossrefs

Distance of 1 instead of 2 gives |A000806|.
Column k=3 of A293157.
Cf. A000699, A001147 (2-uniform set partitions), A003436, A005493, A011968, A170941, A278990 (distance 2+ version), A306386 (cyclical version).

Programs

  • Magma
    I:=[1,0,0,1,10,99]; [n le 5 select I[n] else 2*n*Self(n-1) -2*(3*n-8)*Self(n-2) +2*(3*n-11)*Self(n-3) -2*(n-5)*Self(n-4) -Self(n-5): n in [1..40]]; // G. C. Greubel, Dec 03 2023
    
  • Mathematica
    a[0]=1; a[1]=0; a[2]=0; a[3]=1; a[4]=10; a[5]=99; a[n_] := a[n] = (2*n+2) a[n-1] - (6*n-10) a[n-2] + (6*n-16) a[n-3] - (2*n-8) a[n-4] - a[n-5]; Array[a, 20, 0] (* based on Sullivan's formula, Giovanni Resta, Mar 20 2017 *)
    dtui[{}]:={{}};dtui[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@dtui[Complement[set,s]]]/@Table[{i,j},{j,Select[set,#>i+2&]}];
    Table[Length[dtui[Range[n]]],{n,0,12,2}] (* Gus Wiseman, Feb 27 2019 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A190823
        if (n<6): return (1,0,0,1,10,99)[n]
        else: return 2*(n+1)*a(n-1) - 2*(3*n-5)*a(n-2) + 2*(3*n-8)*a(n-3) - 2*(n-4)*a(n-4) - a(n-5)
    [a(n) for n in range(41)] # G. C. Greubel, Dec 03 2023

Formula

a(n) = 2*(n+1)*a(n-1) - 2*(3*n-5)*a(n-2) + 2*(3*n-8)*a(n-3) - 2*(n-4)*a(n-4) - a(n-5) (proved). - Everett Sullivan, Mar 16 2017
a(n) ~ 2^(n+1/2) * n^n / exp(n+2), based on Sullivan's formula. - Vaclav Kotesovec, Mar 21 2017

Extensions

a(16)-a(20) (using Everett Sullivan's formula) from Giovanni Resta, Mar 20 2017
a(0)=1 prepended by Alois P. Heinz, Oct 17 2017

A322402 Triangle read by rows: The number of chord diagrams with n chords and k topologically connected components, 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 4, 6, 5, 0, 27, 36, 28, 14, 0, 248, 310, 225, 120, 42, 0, 2830, 3396, 2332, 1210, 495, 132, 0, 38232, 44604, 29302, 14560, 6006, 2002, 429, 0, 593859, 678696, 430200, 204540, 81900, 28392, 8008, 1430, 0, 10401712, 11701926, 7204821, 3289296, 1263780, 431256, 129948, 31824, 4862
Offset: 0

Views

Author

R. J. Mathar, Dec 06 2018

Keywords

Comments

If all subsets are allowed instead of just pairs (chords), we get A324173. The rightmost column is A000108 (see Riordan). - Gus Wiseman, Feb 27 2019

Examples

			From _Gus Wiseman_, Feb 27 2019: (Start)
Triangle begins:
  1
  0      1
  0      1      2
  0      4      6      5
  0     27     36     28     14
  0    248    310    225    120     42
  0   2830   3396   2332   1210    495    132
  0  38232  44604  29302  14560   6006   2002    429
  0 593859 678696 430200 204540  81900  28392   8008   1430
Row n = 3 counts the following chord diagrams (see link for pictures):
  {{1,3},{2,5},{4,6}}  {{1,2},{3,5},{4,6}}  {{1,2},{3,4},{5,6}}
  {{1,4},{2,5},{3,6}}  {{1,3},{2,4},{5,6}}  {{1,2},{3,6},{4,5}}
  {{1,4},{2,6},{3,5}}  {{1,3},{2,6},{4,5}}  {{1,4},{2,3},{5,6}}
  {{1,5},{2,4},{3,6}}  {{1,5},{2,3},{4,6}}  {{1,6},{2,3},{4,5}}
                       {{1,5},{2,6},{3,4}}  {{1,6},{2,5},{3,4}}
                       {{1,6},{2,4},{3,5}}
(End)
		

Crossrefs

Cf. A000699 (k = 1 column), A001147 (row sums), A000108 (diagonal), A002694 (subdiagonal k = n - 1).

Formula

The g.f. satisfies g(z,w) = 1+w*A000699(w*g^2), where A000699(z) is the g.f. of A000699.

Extensions

Offset changed to 0 by Gus Wiseman, Feb 27 2019

A293156 Number of linear chord diagrams with n+2 chords such that every chord has length at least n.

Original entry on oeis.org

15, 36, 99, 292, 876, 2628, 7884, 23652, 70956, 212868, 638604, 1915812, 5747436, 17242308, 51726924, 155180772, 465542316, 1396626948, 4189880844, 12569642532, 37708927596, 113126782788, 339380348364, 1018141045092, 3054423135276, 9163269405828, 27489808217484
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2017

Keywords

Crossrefs

A diagonal of A293157.

Programs

  • Mathematica
    Join[{15,36,99},NestList[3#&,292,30]] (* Harvey P. Dale, Sep 25 2018 *)
  • PARI
    Vec(x*(15 - 9*x - 9*x^2 - 5*x^3) / (1 - 3*x) + O(x^30)) \\ Colin Barker, Oct 18 2017

Formula

G.f.: (5*x^3+9*x^2+9*x-15)*x/(3*x-1). - Alois P. Heinz, Oct 17 2017
From Colin Barker, Oct 18 2017: (Start)
a(n) = 292*3^(n-4) for n>3.
a(n) = 3*a(n-1) for n>4.
(End)

Extensions

More terms from Alois P. Heinz, Oct 17 2017

A190824 Number of permutations of 2 copies of 1..n introduced in order 1..n with no element equal to another within a distance of 3.

Original entry on oeis.org

1, 0, 0, 0, 1, 20, 292, 4317, 69862, 1251584, 24728326, 535333713, 12616277612, 321762301156, 8833356675295, 259803215904436, 8151872288855008, 271848098526643604, 9602477503845334715, 358185069617609239664, 14070369448248794118128, 580623906507508489287367
Offset: 0

Views

Author

R. H. Hardin, May 21 2011

Keywords

Examples

			Some solutions for n=5
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..2....2....2....2....2....2....2....2....2....2....2....2....2....2....2....2
..3....3....3....3....3....3....3....3....3....3....3....3....3....3....3....3
..4....4....4....4....4....4....4....4....4....4....4....4....4....4....4....4
..5....5....5....1....5....5....1....5....5....5....5....5....1....5....5....5
..2....1....2....5....1....1....5....1....1....1....2....2....5....1....2....2
..3....3....3....3....3....2....2....2....3....2....3....3....2....3....1....1
..4....4....1....4....4....3....4....4....2....3....1....4....3....2....3....3
..1....5....5....2....2....4....3....3....5....5....4....5....4....4....4....5
..5....2....4....5....5....5....5....5....4....4....5....1....5....5....5....4
		

Crossrefs

Column k=4 of A293157.

Formula

a(n) ~ 2^(n + 1/2) * n^n / exp(n+3). - Vaclav Kotesovec, Oct 26 2017

Extensions

a(0)=1 prepended and a(15)-a(21) added by Alois P. Heinz, Oct 17 2017

A190825 Number of permutations of 2 copies of 1..n introduced in order 1..n with no element equal to another within a distance of 4.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 40, 876, 16924, 332507, 6944594, 156127796, 3783620060, 98614428186, 2754950165519, 82200735013648, 2610496155216456, 87952061484214504, 3134296573781405311, 117816169705165137052, 4659486136831587519216, 193431371632142599974128
Offset: 0

Views

Author

R. H. Hardin, May 21 2011

Keywords

Examples

			Some solutions for n=6
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..2....2....2....2....2....2....2....2....2....2....2....2....2....2....2....2
..3....3....3....3....3....3....3....3....3....3....3....3....3....3....3....3
..4....4....4....4....4....4....4....4....4....4....4....4....4....4....4....4
..5....5....5....5....5....5....5....5....5....5....5....5....5....5....5....5
..6....6....6....6....6....6....6....6....6....6....1....1....1....6....6....1
..1....2....1....2....1....1....2....2....1....2....6....6....6....1....2....6
..2....3....3....3....3....2....3....3....3....3....3....2....2....3....1....2
..3....1....2....1....4....3....1....4....2....4....4....4....3....4....4....4
..5....4....5....5....5....4....5....5....4....1....2....3....5....5....5....5
..4....6....6....4....2....6....6....1....6....5....5....5....4....6....3....3
..6....5....4....6....6....5....4....6....5....6....6....6....6....2....6....6
		

Crossrefs

Column k=5 of A293157.

Formula

a(n) ~ 2^(n + 1/2) * n^n / exp(n+4). - Vaclav Kotesovec, Oct 26 2017

Extensions

a(0), a(18)-a(21) from Alois P. Heinz, Oct 17 2017
Showing 1-9 of 9 results.