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.

Previous Showing 11-20 of 28 results. Next

A279563 Number of length n inversion sequences avoiding the patterns 102, 201, and 210.

Original entry on oeis.org

1, 1, 2, 6, 22, 85, 328, 1253, 4754, 17994, 68158, 258808, 985906, 3768466, 14451386, 55585014, 214377618, 828795169, 3211030684, 12464308997, 48465092366, 188733879657, 735977084412, 2873525548315, 11231884145434, 43947466923095, 172115939825516
Offset: 0

Views

Author

Megan A. Martinez, Feb 09 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_j <> e_k and e_i <> e_k. This is the same as the set of length n inversion sequences avoiding 102, 201, and 210.

Examples

			The length 4 inversion sequences avoiding (102, 201, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0100, 0101, 0110, 0111, 0112, 0113, 0120, 0121, 0122, 0123.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<4, n!,
          ((2*(12*n^3-91*n^2+213*n-149))*a(n-1)
          -(3*(21*n^3-162*n^2+392*n-291))*a(n-2)
          +(2*(33*n^3-257*n^2+633*n-484))*a(n-3)
          -(4*(2*n-7))*(3*n^2-13*n+13)*a(n-4))
           / ((n-1)*(3*n^2-19*n+29)))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 22 2017
  • Mathematica
    a[n_] := a[n] = If[n < 4, n!, ((2*(12*n^3 - 91*n^2 + 213*n - 149))*a[n-1] - (3*(21*n^3 - 162*n^2 + 392*n - 291))*a[n-2] + (2*(33*n^3 - 257*n^2 + 633*n - 484))*a[n-3] - (4*(2*n - 7))*(3*n^2 - 13*n + 13)*a[n-4]) / ((n - 1)*(3*n^2 - 19*n + 29))]; Array[a, 30, 0] (* Jean-François Alcover, Nov 06 2017, after Alois P. Heinz *)

Formula

a(n) ~ 4^n / (3*sqrt(Pi*n)). - Vaclav Kotesovec, Oct 07 2021
G.f.: (2 - 15*x + 32*x^2 - 16*x^3 + x * (1 - 2*x) * (1 + 2*x) * (1 - 4*x)^(1/2)) / (2 * (1 - x)^2 * (1 - 2*x) * (1 - 4*x)). - Nathan J. Britt, Jun 08 2025

Extensions

a(10)-a(26) from Alois P. Heinz, Feb 22 2017

A279567 Number of length n inversion sequences avoiding the patterns 100, 110, 120, and 210.

Original entry on oeis.org

1, 1, 2, 6, 21, 82, 343, 1509, 6893, 32419, 156058, 765578, 3815062, 19263736, 98368919, 507197436, 2637242188, 13814247530, 72834238423, 386244387688, 2058933104170, 11026807340592, 59304897232442, 320181600386661, 1734685419170666, 9428340999504441
Offset: 0

Views

Author

Megan A. Martinez, Feb 09 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i= e_k and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 100, 110, 120, and 210.

Examples

			The length 4 inversion sequences avoiding (100, 110, 120, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0101, 0102, 0103, 0111, 0112, 0113, 0121, 0122, 0123.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, m) option remember; `if`(n=0, 1, add((h->
          b(n-1, i-h+1, max(m, j)-h))(max(0, min(m-1, j))), j=1..i))
        end:
    a:= n-> b(n, 1, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 23 2017
  • Mathematica
    b[n_, i_, m_] := b[n, i, m] = If[n == 0, 1, Sum[b[n-1, i-#+1, Max[m, j]-#]& @ Max[0, Min[m-1, j]], {j, 1, i}]]; a[n_] := b[n, 1, 0]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jul 10 2017, after Alois P. Heinz *)

Formula

a(n) ~ c * (1 + sqrt(2))^(2*n) / n^(3/2), where c = 0.066085708825649431003670013119332303648755519420440375... - Vaclav Kotesovec, Oct 07 2021

Extensions

a(10)-a(25) from Alois P. Heinz, Feb 23 2017

A279568 Number of length n inversion sequences avoiding the patterns 110, 120, 201, and 210.

Original entry on oeis.org

1, 1, 2, 6, 22, 90, 396, 1833, 8801, 43441, 219092, 1124201, 5850414, 30805498, 163824559, 878655117, 4747341879, 25815026491, 141173582016, 775920816789, 4283833709457, 23746640019657, 132116647765569, 737485227605338, 4129174120158569, 23183379592361839
Offset: 0

Views

Author

Megan A. Martinez, Feb 21 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_k and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 110, 120, 201, and 210.
It was shown that a_n also counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_j and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 100, 120, 201, and 210.

Examples

			The length 4 inversion sequences avoiding (110, 120, 201, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0100, 0101, 0102, 0103, 0111, 0112, 0113, 0121, 0122, 0123.
The length 4 inversion sequences avoiding (100, 120, 201, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0101, 0102, 0103, 0110, 0111, 0112, 0113, 0121, 0122, 0123.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, l) option remember; `if`(n=0, 1, add((h->
          b(n-1, i-h+2, j-h+1))(max(1, `if`(j=l, 0, l))), j=1..i))
        end:
    a:= n-> b(n, 1$2):
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 23 2017
  • Mathematica
    b[n_, i_, l_] := b[n, i, l] = If[n == 0, 1, Sum[b[n-1, i-#+2, j-#+1]& @ Max[1, If[j == l, 0, l]], {j, 1, i}]]; a[n_] :=  b[n, 1, 1];  Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jul 10 2017, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n / n^(3/2), where d = 5.98041772076926677236919875200507... is the positive root of the equation -32 - 195*d - 12*d^2 - 112*d^3 + 20*d^4 = 0 and c = 0.1056946795054351807407212356928404107733262398133039312067247126343... - Vaclav Kotesovec, Oct 07 2021

Extensions

a(10)-a(25) from Alois P. Heinz, Feb 23 2017

A279569 Number of length n inversion sequences avoiding the patterns 110, 120, and 210.

Original entry on oeis.org

1, 1, 2, 6, 22, 91, 409, 1953, 9763, 50583, 269697, 1472080, 8193306, 46359256, 266023710, 1545165168, 9070274236, 53739936609, 321025143482, 1931764542709, 11700651842997, 71288958790413, 436662467207291, 2687623420862395, 16615163817647042, 103131646740020637
Offset: 0

Views

Author

Megan A. Martinez, Feb 21 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_k and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 110, 120, and 210.
It was shown that a_n also counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_j >= e_k and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 100, 120, and 210.

Examples

			The length 4 inversion sequences avoiding (110, 120, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0100, 0101, 0102, 0103, 0111, 0112, 0113, 0121, 0122, 0123.
The length 4 inversion sequences avoiding (100, 120, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0101, 0102, 0103, 0110, 0111, 0112, 0113, 0121, 0122, 0123.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1,
          add(b(n-1, i-min(t, j)+2, abs(t-j)+1), j=1..i))
        end:
    a:= n-> b(n, 1$2):
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 21 2017
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, 1, Sum[b[n - 1, i - Min[t, j] + 2, Abs[t-j]+1], {j, 1, i}]]; a[n_] :=  b[n, 1, 1]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jul 10 2017, after Alois P. Heinz *)

Formula

a(n) ~ c * (27/4)^n / n^(3/2), where c = 0.0111684107126703379786799829348... - Vaclav Kotesovec, Oct 07 2021

Extensions

a(10)-a(25) from Alois P. Heinz, Feb 21 2017

A279571 Number of length n inversion sequences avoiding the patterns 100, 101, and 201.

Original entry on oeis.org

1, 1, 2, 6, 22, 92, 424, 2106, 11102, 61436, 353980, 2110366, 12955020, 81569168, 525106698, 3447244188, 23028080268, 156246994264, 1075127143948, 7492458675666, 52820934349420, 376331681648402, 2707312468516446, 19650530699752470, 143807774782994412, 1060472244838174574, 7875713244761349666, 58876660310205135380, 442862775457168812898, 3350397169412102710198
Offset: 0

Views

Author

Megan A. Martinez, Feb 21 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_j <= e_k and e_i >= e_k. This is the same as the set of length n inversion sequences avoiding 100, 101, and 201.

Examples

			The length 4 inversion sequences avoiding (100,101,201) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0102, 0103, 0110, 0111, 0112, 0113, 0120, 0121, 0122, 0123.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, s, m) option remember;
          `if`(n=0, 1, add(b(n-1, i+1, s minus {$j..m-
          `if`(j=m, 1, 0)} union {i+1}, max(m, j)), j=s))
        end:
    a:= n-> b(n, 1, {1}, 0):
    seq(a(n), n=0..15);  # Alois P. Heinz, Feb 22 2017
  • Mathematica
    b[n_, i_, s_, m_] := b[n, i, s, m] = If[n == 0, 1, Sum[b[n-1, i+1, s  ~Complement~ Range[j, m - If[j == m, 1, 0]] ~Union~ {i+1}, Max[m, j]], {j, s}]];
    a[n_] := b[n, 1, {1}, 0];
    Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Oct 27 2017, after Alois P. Heinz *)

Extensions

a(10)-a(25) from Alois P. Heinz, Feb 22 2017
a(26)-a(29) from Vaclav Kotesovec, Oct 07 2021

A279573 Number of length n inversion sequences avoiding the patterns 120 and 210.

Original entry on oeis.org

1, 1, 2, 6, 23, 102, 499, 2625, 14601, 84847, 510614, 3161964, 20050770, 129718404, 853689031, 5701759424, 38574689104, 263936457042, 1824032887177, 12718193293888, 89386742081688, 632746535420834, 4508140253686638, 32308561883462867, 232790342330880572
Offset: 0

Views

Author

Megan A. Martinez, Feb 21 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_j > e_k and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 120 and 210.

Examples

			The length 4 inversion sequences avoiding (120,210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0100, 0101, 0102, 0103, 0110, 0111, 0112, 0113, 0121, 0122, 0123.
		

Crossrefs

Formula

a(n) ~ c * 8^n / n^(3/2), where c = 0.0013548789253263217919... - Vaclav Kotesovec, Oct 07 2021

Extensions

a(10)-a(24) from Alois P. Heinz, Feb 21 2017

A279572 Number of length n inversion sequences avoiding the patterns 120, 201, and 210.

Original entry on oeis.org

1, 1, 2, 6, 23, 101, 484, 2468, 13166, 72630, 411076, 2374188, 13938018, 82932254, 499031324, 3031610924, 18568429963, 114541486785, 710973143614, 4437415155234, 27831038618735, 175318861863701, 1108762012137252, 7037137177329268, 44808588430903068
Offset: 0

Views

Author

Megan A. Martinez, Feb 21 2017

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_j <> e_k and e_i > e_k. This is the same as the set of length n inversion sequences avoiding 120, 201, and 210.

Examples

			The length 4 inversion sequences avoiding (120, 201, 210) are 0000, 0001, 0002, 0003, 0010, 0011, 0012, 0013, 0020, 0021, 0022, 0023, 0100, 0101, 0102, 0103, 0110, 0111, 0112, 0113, 0121, 0122, 0123.
		

Crossrefs

Extensions

a(12)-a(15) from Bert Dobbelaere, Dec 30 2018
a(16)-a(24) from Toufik Mansour et al. added by Stefano Spezia, Jan 20 2024

A361801 Number of nonempty subsets of {1..n} with median n/2.

Original entry on oeis.org

0, 0, 1, 1, 4, 4, 14, 14, 49, 49, 175, 175, 637, 637, 2353, 2353, 8788, 8788, 33098, 33098, 125476, 125476, 478192, 478192, 1830270, 1830270, 7030570, 7030570, 27088870, 27088870, 104647630, 104647630, 405187825, 405187825, 1571990935, 1571990935
Offset: 0

Views

Author

Gus Wiseman, Apr 07 2023

Keywords

Comments

The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).

Examples

			The subset {1,2,3,5} of {1..5} has median 5/2, so is counted under a(5).
The subset {2,3,5} of {1..6} has median 6/2, so is counted under a(6).
The a(0) = 0 through a(7) = 14 subsets:
  .  .  {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
                    {1,3}    {2,3}      {1,5}        {2,5}
                    {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                    {1,2,4}  {1,2,3,5}  {1,3,4}      {1,2,5,6}
                                        {1,3,5}      {1,2,5,7}
                                        {1,3,6}      {1,3,4,5}
                                        {2,3,4}      {1,3,4,6}
                                        {2,3,5}      {1,3,4,7}
                                        {2,3,6}      {2,3,4,5}
                                        {1,2,4,5}    {2,3,4,6}
                                        {1,2,4,6}    {2,3,4,7}
                                        {1,2,3,4,5}  {1,2,3,4,5,6}
                                        {1,2,3,4,6}  {1,2,3,4,5,7}
                                        {1,2,3,5,6}  {1,2,3,4,6,7}
		

Crossrefs

A bisection is A079309.
The case with n's has bisection A057552.
The case without n's is A100066, bisection A006134.
A central diagonal of A231147.
A version for partitions is A361849.
For mean instead of median we have A362046.
A000975 counts subsets with integer median, for mean A327475.
A007318 counts subsets by length.
A013580 appears to count subsets by median, by mean A327481.
A360005(n)/2 represents the median statistic for partitions.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Median[#]==n/2&]],{n,0,10}]

Formula

a(n) = A079309(floor(n/2)). - Alois P. Heinz, Apr 11 2023

A070925 Number of subsets of A = {1,2,...,n} that have the same center of gravity as A, i.e., (n+1)/2.

Original entry on oeis.org

1, 1, 3, 3, 7, 7, 19, 17, 51, 47, 151, 137, 471, 427, 1519, 1391, 5043, 4651, 17111, 15883, 59007, 55123, 206259, 193723, 729095, 688007, 2601639, 2465133, 9358943, 8899699, 33904323, 32342235, 123580883, 118215779, 452902071, 434314137, 1667837679, 1602935103
Offset: 1

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), May 20 2002

Keywords

Comments

From Gus Wiseman, Apr 15 2023: (Start)
Also the number of nonempty subsets of {0..n} with mean n/2. The a(0) = 1 through a(5) = 7 subsets are:
{0} {0,1} {1} {0,3} {2} {0,5}
{0,2} {1,2} {0,4} {1,4}
{0,1,2} {0,1,2,3} {1,3} {2,3}
{0,2,4} {0,1,4,5}
{1,2,3} {0,2,3,5}
{0,1,3,4} {1,2,3,4}
{0,1,2,3,4} {0,1,2,3,4,5}
(End)

Examples

			Of the 32 (2^5) sets which can be constructed from the set A = {1,2,3,4,5} only the sets {3}, {2, 3, 4}, {2, 4}, {1, 2, 4, 5}, {1, 2, 3, 4, 5}, {1, 3, 5}, {1, 5} give an average of 3.
		

Crossrefs

The odd bisection is A000980(n) - 1 = 2*A047653(n) - 1.
For median instead of mean we have A100066, bisection A006134.
Including the empty set gives A222955.
The one-based version is A362046, even bisection A047653(n) - 1.
A007318 counts subsets by length.
A067538 counts partitions with integer mean, strict A102627.
A231147 counts subsets by median.
A327481 counts subsets by integer mean.

Programs

  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; f[n_] := Block[{s = Subsets[n], c = 0, k = 2}, While[k < 2^n + 1, If[ (Plus @@ s[[k]]) / Length[s[[k]]] == (n + 1)/2, c++ ]; k++ ]; c]; Table[ f[n], {n, 1, 20}]
    (* second program *)
    Table[Length[Select[Subsets[Range[0,n]],Mean[#]==n/2&]],{n,0,10}] (* Gus Wiseman, Apr 15 2023 *)

Formula

From Gus Wiseman, Apr 18 2023: (Start)
a(2n+1) = A000980(n) - 1.
a(n) = A222955(n) - 1.
a(n) = 2*A362046(n) + 1.
(End)

Extensions

Edited by Robert G. Wilson v and John W. Layman, May 25 2002
a(34)-a(38) from Fausto A. C. Cariboni, Oct 08 2020

A362046 Number of nonempty subsets of {1..n} with mean n/2.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 9, 8, 25, 23, 75, 68, 235, 213, 759, 695, 2521, 2325, 8555, 7941, 29503, 27561, 103129, 96861, 364547, 344003, 1300819, 1232566, 4679471, 4449849, 16952161, 16171117, 61790441, 59107889, 226451035, 217157068, 833918839, 801467551, 3084255127
Offset: 0

Views

Author

Gus Wiseman, Apr 12 2023

Keywords

Examples

			The a(2) = 1 through a(7) = 8 subsets:
  {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
              {1,3}    {2,3}      {1,5}        {2,5}
              {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                                  {1,2,6}      {1,2,4,7}
                                  {1,3,5}      {1,2,5,6}
                                  {2,3,4}      {1,3,4,6}
                                  {1,2,3,6}    {2,3,4,5}
                                  {1,2,4,5}    {1,2,3,4,5,6}
                                  {1,2,3,4,5}
		

Crossrefs

Using range 0..n gives A070925.
Including the empty set gives A133406.
Even bisection is A212352.
For median instead of mean we have A361801, the doubling of A079309.
A version for partitions is A361853, for median A361849.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length.
A067538 counts partitions with integer mean, strict A102627.
A231147 appears to count subsets by median, full-steps A013580.
A327475 counts subsets with integer mean, A000975 integer median.
A327481 counts subsets by integer mean.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Mean[#]==n/2&]],{n,0,15}]

Formula

a(n) = (A070925(n) - 1)/2.
a(n) = A133406(n) - 1.
a(2n) = A212352(n) = A000980(n)/2 - 1.
Previous Showing 11-20 of 28 results. Next