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.

A361864 Number of set partitions of {1..n} whose block-medians have integer median.

Original entry on oeis.org

1, 0, 3, 6, 30, 96, 461, 2000, 10727, 57092, 342348
Offset: 1

Views

Author

Gus Wiseman, Apr 04 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 a(1) = 1 through a(4) = 6 set partitions:
  {{1}}  .  {{123}}      {{1}{234}}
            {{13}{2}}    {{123}{4}}
            {{1}{2}{3}}  {{1}{2}{34}}
                         {{12}{3}{4}}
                         {{1}{24}{3}}
                         {{13}{2}{4}}
The set partition {{1,2},{3},{4}} has block-medians {3/2,3,4}, with median 3, so is counted under a(4).
		

Crossrefs

For mean instead of median we have A361865.
For sum instead of outer median we have A361911, means A361866.
A000110 counts set partitions.
A000975 counts subsets with integer median, mean A327475.
A013580 appears to count subsets by median, A327481 by mean.
A308037 counts set partitions with integer average block-size.
A325347 counts partitions w/ integer median, complement A307683.
A360005 gives twice median of prime indices, distinct A360457.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],IntegerQ[Median[Median/@#]]&]],{n,6}]

A361866 Number of set partitions of {1..n} with block-means summing to an integer.

Original entry on oeis.org

1, 1, 1, 3, 8, 22, 75, 267, 1119, 4965, 22694, 117090, 670621, 3866503, 24113829, 161085223, 1120025702, 8121648620, 62083083115, 492273775141, 4074919882483
Offset: 0

Views

Author

Gus Wiseman, Apr 04 2023

Keywords

Examples

			The a(1) = 1 through a(4) = 8 set partitions:
  {{1}}  {{1}{2}}  {{123}}      {{1}{234}}
                   {{13}{2}}    {{12}{34}}
                   {{1}{2}{3}}  {{123}{4}}
                                {{13}{24}}
                                {{14}{23}}
                                {{1}{24}{3}}
                                {{13}{2}{4}}
                                {{1}{2}{3}{4}}
The set partition y = {{1,2},{3,4}} has block-means {3/2,7/2}, with sum 5, so y is counted under a(4).
		

Crossrefs

For mean instead of sum we have A361865, for median A361864.
For median instead of mean we have A361911.
A000110 counts set partitions.
A067538 counts partitions with integer mean, ranks A326836, strict A102627.
A308037 counts set partitions with integer mean block-size.
A327475 counts subsets with integer mean, median A000975.
A327481 counts subsets by mean, median A013580.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],IntegerQ[Total[Mean/@#]]&]],{n,6}]

Extensions

a(14)-a(20) from Christian Sievers, May 12 2025

A361911 Number of set partitions of {1..n} with block-medians summing to an integer.

Original entry on oeis.org

1, 1, 3, 10, 30, 107, 479, 2249, 11173, 60144, 351086, 2171087, 14138253, 97097101, 701820663, 5303701310, 41838047938, 343716647215, 2935346815495, 25999729551523, 238473713427285, 2261375071834708, 22141326012712122, 223519686318676559, 2323959300370456901
Offset: 1

Views

Author

Gus Wiseman, Apr 14 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 a(1) = 1 through a(4) = 10 set partitions:
  {{1}}  {{1}{2}}  {{123}}      {{1}{234}}
                   {{13}{2}}    {{12}{34}}
                   {{1}{2}{3}}  {{123}{4}}
                                {{124}{3}}
                                {{13}{24}}
                                {{134}{2}}
                                {{14}{23}}
                                {{1}{24}{3}}
                                {{13}{2}{4}}
                                {{1}{2}{3}{4}}
The set partition {{1,4},{2,3}} has medians {5/2,5/2}, with sum 5, so is counted under a(4).
		

Crossrefs

For median instead of sum we have A361864.
For mean of means we have A361865.
For mean instead of median we have A361866.
A000110 counts set partitions.
A000975 counts subsets with integer median, mean A327475.
A013580 appears to count subsets by median, A327481 by mean.
A308037 counts set partitions with integer average block-size.
A325347 = partitions w/ integer median, complement A307683, strict A359907.
A360005 gives twice median of prime indices, distinct A360457.

Programs

  • Mathematica
    sps[{}]:={{}}; sps[set:{i_,_}] := Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]] /@ Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]], IntegerQ[Total[Median/@#]]&]],{n,10}]

Extensions

a(12)-a(25) from Christian Sievers, Aug 26 2024

A361865 Number of set partitions of {1..n} such that the mean of the means of the blocks is an integer.

Original entry on oeis.org

1, 0, 3, 2, 12, 18, 101, 232, 1547, 3768, 24974, 116728, 687419, 3489664, 26436217, 159031250, 1129056772
Offset: 1

Views

Author

Gus Wiseman, Apr 04 2023

Keywords

Examples

			The set partition y = {{1,4},{2,5},{3}} has block-means {5/2,7/2,3}, with mean 3, so y is counted under a(5).
The a(1) = 1 through a(5) = 12 set partitions:
  {{1}}  .  {{123}}      {{1}{234}}  {{12345}}
            {{13}{2}}    {{123}{4}}  {{1245}{3}}
            {{1}{2}{3}}              {{135}{24}}
                                     {{15}{234}}
                                     {{1}{234}{5}}
                                     {{12}{3}{45}}
                                     {{135}{2}{4}}
                                     {{14}{25}{3}}
                                     {{15}{24}{3}}
                                     {{1}{24}{3}{5}}
                                     {{15}{2}{3}{4}}
                                     {{1}{2}{3}{4}{5}}
		

Crossrefs

For median instead of mean we have A361864.
For sum instead of outer mean we have A361866, median A361911.
A000110 counts set partitions.
A067538 counts partitions with integer mean, ranks A326836, strict A102627.
A308037 counts set partitions whose block-sizes have integer mean.
A327475 counts subsets with integer mean, median A000975.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],IntegerQ[Mean[Mean/@#]]&]],{n,6}]

Extensions

a(13)-a(17) from Christian Sievers, Jun 30 2025

A361910 Number of set partitions of {1..n} such that the mean of the means of the blocks is (n+1)/2.

Original entry on oeis.org

1, 2, 3, 7, 12, 47, 99, 430, 1379, 5613, 21416, 127303, 532201, 3133846, 18776715, 114275757, 737859014
Offset: 1

Views

Author

Gus Wiseman, Apr 14 2023

Keywords

Comments

Since (n+1)/2 is the mean of {1..n}, this sequence counts a type of "transitive" set partitions.

Examples

			The a(1) = 1 through a(5) = 12 set partitions:
  {{1}}  {{12}}    {{123}}      {{1234}}        {{12345}}
         {{1}{2}}  {{13}{2}}    {{12}{34}}      {{1245}{3}}
                   {{1}{2}{3}}  {{13}{24}}      {{135}{24}}
                                {{14}{23}}      {{15}{234}}
                                {{1}{23}{4}}    {{1}{234}{5}}
                                {{14}{2}{3}}    {{12}{3}{45}}
                                {{1}{2}{3}{4}}  {{135}{2}{4}}
                                                {{14}{25}{3}}
                                                {{15}{24}{3}}
                                                {{1}{24}{3}{5}}
                                                {{15}{2}{3}{4}}
                                                {{1}{2}{3}{4}{5}}
The set partition {{1,3},{2,4}} has means {2,3}, with mean 5/2, so is counted under a(4).
The set partition {{1,3,5},{2,4}} has means {3,3}, with mean 3, so is counted under a(5).
		

Crossrefs

For median instead of mean we have A361863.
A000110 counts set partitions.
A308037 counts set partitions with integer mean block-size.
A327475 counts subsets with integer mean, A000975 with integer median.
A327481 counts subsets by mean, A013580 by median.
A361865 counts set partitions with integer mean of means.
A361911 counts set partitions with integer sum of means.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]] /@ Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],Mean[Join@@#]==Mean[Mean/@#]&]],{n,8}]

Extensions

a(13)-a(17) from Christian Sievers, May 12 2025

A308463 a(n) = Sum_{k=1..n, gcd(n,k) = 1} Stirling2(n,k).

Original entry on oeis.org

1, 1, 4, 7, 51, 16, 876, 2045, 15475, 15256, 678569, 2006863, 27644436, 46065293, 669225640, 5235101739, 82864869803, 234937438645, 5832742205056, 25117329128165, 235703526149476, 1886712616836675, 44152005855084345, 102153081219673712, 3428690854204959151
Offset: 1

Views

Author

Ilya Gutkovskiy, May 28 2019

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[If[GCD[n, k] == 1, StirlingS2[n, k] , 0], {k, 1, n}]; Table[a[n], {n, 1, 25}]
  • PARI
    a(n) = sum(k=1, n, if (gcd(n,k)==1, stirling(n, k, 2))); \\ Michel Marcus, May 28 2019

A309171 a(n) = Product_{d|n} Stirling2(n,d).

Original entry on oeis.org

1, 1, 1, 7, 1, 2790, 1, 216027, 3025, 21730275, 1, 143362465643243568744, 1, 404056132480, 500592722458920, 12056706465173227408551, 1, 99260615209905051640711424376160950, 1, 105138504356810366747790360523498652392500, 143413971571112402506500, 768149712982621155186
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 15 2019

Keywords

Crossrefs

Cf. A008277, A008578 (positions of 1's), A058808, A308037, A309169.

Programs

  • Magma
    [(&*[StirlingSecond(n,d): d in Divisors(n)]): n in [1..30]]; // Vincenzo Librandi, Jul 16 2019
  • Mathematica
    Table[Product[StirlingS2[n, d], {d, Divisors[n]}], {n, 1, 22}]
  • PARI
    a(n) = my(d=divisors(n)); prod(k=1, #d, stirling(n, d[k], 2)); \\ Michel Marcus, Jul 16 2019
    

A309911 a(n) = Sum_{k=1..n} Stirling2(n,k) * floor(n/k).

Original entry on oeis.org

1, 3, 7, 25, 71, 360, 1310, 7195, 35740, 213318, 1132154, 8409475, 50344672, 366939569, 2728237607, 21375289293, 159969524749, 1462761108082, 11896122581676, 107011124829787, 1031744001100166, 9684995830526129, 91735916202054984, 1010641832989185386, 10131466944871497886
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 22 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[StirlingS2[n, k] Floor[n/k] , {k, 1, n}], {n, 1, 25}]
    Table[SeriesCoefficient[1/(1 - x) Sum[StirlingS2[n, k] x^k/(1 - x^k), {k, 1, n}], {x, 0, n}], {n, 1, 25}]
    Table[Sum[Sum[StirlingS2[n, d], {d, Divisors[k]}], {k, 1, n}], {n, 1, 25}]
  • PARI
    a(n) = sum(k=1, n, stirling(n, k, 2) * (n\k)); \\ Michel Marcus, Aug 23 2019

Formula

a(n) = [x^n] (1/(1 - x)) * Sum_{k=1..n} Stirling2(n,k) * x^k/(1 - x^k).
a(n) = Sum_{k=1..n} Sum_{d|k} Stirling2(n,d).

A348856 a(n) = Sum_{d|n} (Stirling2(n,d) mod 2).

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 2, 4, 3, 4, 2, 4, 2, 3, 3, 5, 2, 5, 2, 5, 3, 3, 2, 5, 3, 3, 4, 4, 2, 5, 2, 6, 3, 4, 3, 7, 2, 3, 3, 6, 2, 5, 2, 4, 4, 3, 2, 6, 2, 5, 4, 4, 2, 5, 2, 5, 4, 3, 2, 6, 2, 3, 4, 7, 3, 5, 2, 6, 3, 5, 2, 8, 2, 4, 4, 4, 3, 5, 2, 7, 4, 4, 2, 6, 4, 3, 3, 5, 2, 7, 3, 4, 3, 3, 2, 7, 2, 3, 6, 6
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 02 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, Mod[StirlingS2[n, #], 2] &], {n, 1, 100}]
  • PARI
    a(n) = sumdiv(n, d, stirling(n, d, 2) % 2); \\ Michel Marcus, Nov 02 2021
Showing 1-9 of 9 results.