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

A242783 Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step pattern given by the binary expansion of n, where 1=up and 0=down; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 1, 2, 5, 1, 21, 3, 70, 50, 450, 270, 4326, 602, 99, 12, 1, 34944, 5376, 209863, 139714, 13303, 1573632, 1366016, 530432, 158720, 21824925, 15302031, 2715243, 74601, 302273664, 161855232, 14872704, 2854894485, 2600075865, 712988175, 59062275
Offset: 0

Views

Author

Alois P. Heinz, May 22 2014

Keywords

Comments

Sum_{k>0} k*T(n,k) = A249249(n).

Examples

			T(7,3) = 12 because 12 permutations of {1,2,3,4,5,6,7} have exactly 3 (possibly overlapping) occurrences of the consecutive step pattern up, up, up given by the binary expansion of 7 = 111_2: (1,2,3,4,5,7,6), (1,2,3,4,6,7,5), (1,2,3,5,6,7,4), (1,2,4,5,6,7,3), (1,3,4,5,6,7,2), (2,1,3,4,5,6,7), (2,3,4,5,6,7,1), (3,1,2,4,5,6,7), (4,1,2,3,5,6,7), (5,1,2,3,4,6,7), (6,1,2,3,4,5,7), (7,1,2,3,4,5,6).
Triangle T(n,k) begins:
: n\k :       0        1       2       3  4  ...
+-----+------------------------------------
:  0  :       1;
:  1  :       1;                             [row  1 of A008292]
:  2  :       2;                             [row  2 of A008303]
:  3  :       5,       1;                    [row  3 of A162975]
:  4  :      21,       3;                    [row  4 of A242819]
:  5  :      70,      50;                    [row  5 of A227884]
:  6  :     450,     270;                    [row  6 of A242819]
:  7  :    4326,     602,     99,     12, 1; [row  7 of A220183]
:  8  :   34944,    5376;                    [row  8 of A242820]
:  9  :  209863,  139714,  13303;            [row  9 of A230695]
: 10  : 1573632, 1366016, 530432, 158720;    [row 10 of A230797]
		

Crossrefs

Programs

  • Maple
    T:= proc(n) option remember; local b, k, r, h;
          k:= iquo(n,2,'r'); h:= 2^ilog2(n);
          b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
          add(b(u-j, o+j-1, irem(2*t,   h))*`if`(r=0 and t=k, x, 1), j=1..u)+
          add(b(u+j-1, o-j, irem(2*t+1, h))*`if`(r=1 and t=k, x, 1), j=1..o)))
          end: forget(b);
          (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 0))
        end:
    seq(T(n), n=0..15);
  • Mathematica
    T[n_] := T[n] = Module[{b, k, r, h}, {k, r} = QuotientRemainder[n, 2]; h = 2^Floor[Log[2, n]]; b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, Expand[ Sum[b[u - j, o + j - 1, Mod[2*t, h]]*If[r == 0 && t == k, x, 1], {j, 1, u}] + Sum[b[u + j - 1, o - j, Mod[2*t + 1, h]]*If[r == 1 && t == k, x, 1], {j, 1, o}]]]; Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0, 0]]]; Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, Feb 20 2016, after Alois P. Heinz *)

A177479 Number of permutations of 1..n avoiding adjacent step pattern up, down, down.

Original entry on oeis.org

1, 1, 2, 6, 21, 90, 450, 2619, 17334, 129114, 1067661, 9713682, 96393726, 1036348587, 11998603710, 148842430470, 1969461102357, 27688474234602, 412166988789642, 6476330295597051, 107117619952992966, 1860296912926495938, 33845967939906741213, 643778989807702357314
Offset: 0

Views

Author

Submitted independently by Signy Olafsdottir (signy06(AT)ru.is), May 09 2010 (9 terms) and R. H. Hardin, May 10 2010 (17 terms)

Keywords

Comments

Suppose j

Crossrefs

Column k=0 of A242819.
Columns k=4,6 of A242784.

Programs

  • Maple
    b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
           add(b(u+j-1, o-j, 1), j=1..o)+ `if`(t<2,
           add(b(u-j, o+j-1, `if`(t=0, 0, 2)), j=1..u), 0))
        end:
    a:= n-> b(n, 0, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 07 2013
  • Mathematica
    FullSimplify[Rest[CoefficientList[Series[(E^(3*x/2) + 2*Cos[Sqrt[3]*x/2]) / (3*Cos[Sqrt[3]*x/2] - Sqrt[3]*Sin[Sqrt[3]*x/2]), {x, 0, 20}], x] * Range[0, 20]!]] (* Vaclav Kotesovec, Aug 23 2014 *)

Formula

E.g.f.: (exp(3*x/2) + 2*cos(sqrt(3)*x/2)) / (3*cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2)). - Vaclav Kotesovec, Aug 23 2014
a(n) ~ n! * (1+exp(Pi/sqrt(3))) * 3^(3*n/2+1/2) / (2*Pi)^(n+1). - Vaclav Kotesovec, Aug 23 2014

Extensions

a(18)-a(23) from Alois P. Heinz, Oct 06 2013

A295987 Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step patterns 010 or 101, where 1=up and 0=down; triangle T(n,k), n >= 0, k = max(0, n-3), read by rows.

Original entry on oeis.org

1, 1, 2, 6, 14, 10, 52, 36, 32, 204, 254, 140, 122, 1010, 1368, 1498, 620, 544, 5466, 9704, 9858, 9358, 3164, 2770, 34090, 67908, 90988, 72120, 63786, 18116, 15872, 233026, 545962, 762816, 839678, 560658, 470262, 115356, 101042, 1765836, 4604360, 7458522
Offset: 0

Author

Alois P. Heinz, Dec 01 2017

Keywords

Examples

			Triangle T(n,k) begins:
:      1;
:      1;
:      2;
:      6;
:     14,     10;
:     52,     36,     32;
:    204,    254,    140,    122;
:   1010,   1368,   1498,    620,    544;
:   5466,   9704,   9858,   9358,   3164,   2770;
:  34090,  67908,  90988,  72120,  63786,  18116,  15872;
: 233026, 545962, 762816, 839678, 560658, 470262, 115356, 101042;
		

Crossrefs

Column k=0 gives A295974.
Last elements of rows for n>3 give: A001250, A260786, 2*A000111.
Row sums give A000142.

Programs

  • Maple
    b:= proc(u, o, t, h) option remember; expand(
               `if`(u+o=0, 1, `if`(t=0, add(b(u-j, j-1, 1$2), j=1..u),
           add(`if`(h=3, x, 1)*b(u-j, o+j-1, [1, 3, 1][t], 2), j=1..u)+
           add(`if`(t=3, x, 1)*b(u+j-1, o-j, 2, [1, 3, 1][h]), j=1..o))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$3)):
    seq(T(n), n=0..12);
  • Mathematica
    b[u_, o_, t_, h_] := b[u, o, t, h] = Expand[If[u + o == 0, 1, If[t == 0, Sum[b[u - j, j - 1, 1, 1], {j, 1, u}], Sum[If[h == 3, x, 1]*b[u - j, o + j - 1, {1, 3, 1}[[t]], 2], {j, 1, u}] + Sum[If[t == 3, x, 1]*b[u + j - 1, o - j, 2, {1, 3, 1}[[h]]], {j, 1, o}]]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, 0, 0, 0]];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jun 07 2018, from Maple *)

A246246 Number of permutations of [n] with exactly one occurrence of the consecutive step pattern up, down, down.

Original entry on oeis.org

3, 30, 270, 2322, 20772, 195372, 1958337, 20933154, 238789782, 2900868876, 37451986200, 512534035080, 7416327050415, 113185393797510, 1817654015037150, 30647027466113094, 541407973316966604, 10001886705503187732, 192877025408450517501, 3876090406516703418282
Offset: 4

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=1 of A242819.

Programs

  • Maple
    b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
          add(b(u-j, o+j-1, [1, 3, 1][t])*`if`(t=3, x, 1), j=1..u)+
          add(b(u+j-1, o-j, 2), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)):
    seq([T(n)][2], n=4..20); # Vaclav Kotesovec, Aug 22 2014 after Alois P. Heinz
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, Expand[Sum[b[u - j, o + j - 1, {1, 3, 1}[[t]]]*If[t == 3, x, 1], {j, 1, u}] + Sum[b[u + j - 1, o - j, 2], {j, 1, o}]]];
    a[n_] := Coefficient[b[n, 0, 1], x, 1];
    a /@ Range[4, 20] (* Jean-François Alcover, Dec 28 2020, after Maple *)

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n, where c = 0.6335500498606750386938465... = c0 * (c0-1)/3, and c0 = (1+exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 22 2014

A246247 Number of permutations of [n] with exactly two occurrences of the consecutive step pattern up, down, down.

Original entry on oeis.org

99, 2214, 38394, 591543, 8826246, 131367258, 1989555210, 30951663300, 497599843140, 8291940960690, 143459287215300, 2578465192541220, 48147387009459165, 933704978071539690, 18794023286090727870, 392361396798154377681, 8489006744706293477274
Offset: 7

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=2 of A242819.

Programs

  • Maple
    b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
          add(b(u-j, o+j-1, [1, 3, 1][t])*`if`(t=3, x, 1), j=1..u)+
          add(b(u+j-1, o-j, 2), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)):
    seq([T(n)][3], n=7..20); # Vaclav Kotesovec, Aug 22 2014 after Alois P. Heinz
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, Expand[Sum[b[u - j, o + j - 1, {1, 3, 1}[[t]]]*If[t == 3, x, 1], {j, 1, u}] + Sum[b[u + j - 1, o - j, 2], {j, 1, o}]]];
    a[n_] := Coefficient[b[n, 0, 1], x, 2];
    a /@ Range[7, 20] (* Jean-François Alcover, Dec 28 2020, after Maple *)

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n^2, where c = 0.10205535828170995196503... = c0 * (c0-1)^2 / 18, and c0 = (1 + exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 22 2014

A246248 Number of permutations of [n] with exactly three occurrences of the consecutive step pattern up, down, down.

Original entry on oeis.org

11259, 443718, 12450834, 297195804, 6589314360, 141014406600, 2982538767870, 63210091744620, 1354523537530620, 29518995185712180, 656767731733672680, 14956075051814966040, 349170616179434073825, 8366057002343951876610, 205839505389444095064510
Offset: 10

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=3 of A242819.

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n^3, where c = 0.01095971939528021798... = c0 * (c0-1)^3 / (3^3 * 3!), and c0 = (1 + exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 26 2014

A246249 Number of permutations of [n] with exactly four occurrences of the consecutive step pattern up, down, down.

Original entry on oeis.org

3052323, 186723630, 7683652710, 260901740745, 8002149813810, 231524173618290, 6486876741415365, 178899784802719290, 4910005699045578270, 135118835430805648215, 3748167756629344500390, 105205858082972481706290, 2996195115836815163207370
Offset: 13

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=4 of A242819.

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n^4, where c = 0.000882722753946826148... = c0 * (c0-1)^4 / (3^4 * 4!), and c0 = (1 + exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 26 2014

A246250 Number of permutations of [n] with exactly five occurrences of the consecutive step pattern up, down, down.

Original entry on oeis.org

1620265923, 142031290158, 8039798211078, 366995453376294, 14827018289073804, 555488440936519572, 19848769453749875607, 688735406876831016606, 23495176763112174568146, 794853120296757717355104, 26836227616917587293450368, 908479209956520414451380624
Offset: 16

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=5 of A242819.

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n^5, where c = 0.00005687732922585807984... = c0 * (c0-1)^5 / (3^5 * 5!), and c0 = (1 + exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 26 2014

A246251 Number of permutations of [n] with exactly six occurrences of the consecutive step pattern up, down, down.

Original entry on oeis.org

1488257158851, 176902009674966, 13166075391964578, 775944032960346939, 39844140679287441918, 1872063201155821139178, 82897279832156950225548, 3526803545750650310760216, 146090377422354615989531688, 5948505245302032452585146020, 239776137775416266444362226760
Offset: 19

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=6 of A242819.

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n^6, where c = 0.000003054026651631929902... = c0 * (c0-1)^6 / (3^6 * 6!), and c0 = (1 + exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 26 2014

A246252 Number of permutations of [n] with exactly seven occurrences of the consecutive step pattern up, down, down.

Original entry on oeis.org

2172534146099019, 336291324862551606, 31816048233798681066, 2348418329934108057072, 149140942861163014893024, 8573289075750149662810032, 460018114299281721089786796, 23509721961960146267578379640, 1160583084129910496820714859320
Offset: 22

Author

Alois P. Heinz, Aug 20 2014

Keywords

Crossrefs

Column k=7 of A242819.

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n! * n^7, where c = 0.0000001405593242634352116... = c0 * (c0-1)^7 / (3^7 * 7!), and c0 = (1 + exp(Pi/sqrt(3))) * sqrt(3) / (2*Pi). - Vaclav Kotesovec, Aug 26 2014
Showing 1-10 of 13 results. Next