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 31-40 of 105 results. Next

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

A326493 Sum of multinomials M(n-k; p_1-1, ..., p_k-1), where p = (p_1, ..., p_k) ranges over all partitions of n into distinct parts (k is a partition length).

Original entry on oeis.org

1, 1, 1, 2, 2, 5, 9, 21, 38, 146, 322, 902, 3106, 8406, 35865, 123321, 393691, 1442688, 7310744, 23471306, 129918661, 500183094, 2400722981, 9592382321, 47764284769, 280267554944, 1247781159201, 7620923955225, 36278364107926, 189688942325418, 1124492015730891
Offset: 0

Views

Author

Alois P. Heinz, Sep 22 2019

Keywords

Comments

Number of partitions of [n] such that each block contains its size as an element. So the block sizes have to be distinct. a(6) = 9: 123456, 12|3456, 1345|26, 1346|25, 1456|23, 1|23456, 1|24|356, 1|25|346, 1|26|345.

Crossrefs

Programs

  • Maple
    with(combinat):
    a:= n-> add(multinomial(n-nops(p), map(x-> x-1, p)[], 0),
            p=select(l-> nops(l)=nops({l[]}), partition(n))):
    seq(a(n), n=0..30);
    # second Maple program:
    b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 b(n$3):
    seq(a(n), n=0..31);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n==0, p!, b[n, i-1, p] + b[n-i, Min[n-i, i-1], p-1]/(i-1)!]];
    a[n_] := b[n, n, n];
    a /@ Range[0, 31] (* Jean-François Alcover, Dec 09 2020, after Alois P. Heinz *)

A358912 Number of finite sequences of integer partitions with total sum n and all distinct lengths.

Original entry on oeis.org

1, 1, 2, 5, 11, 23, 49, 103, 214, 434, 874, 1738, 3443, 6765, 13193, 25512, 48957, 93267, 176595, 332550, 622957, 1161230, 2153710, 3974809, 7299707, 13343290, 24280924, 43999100, 79412942, 142792535, 255826836, 456735456, 812627069, 1440971069, 2546729830
Offset: 0

Views

Author

Gus Wiseman, Dec 07 2022

Keywords

Examples

			The a(1) = 1 through a(4) = 11 sequences:
  (1)  (2)   (3)      (4)
       (11)  (21)     (22)
             (111)    (31)
             (1)(11)  (211)
             (11)(1)  (1111)
                      (11)(2)
                      (1)(21)
                      (2)(11)
                      (21)(1)
                      (1)(111)
                      (111)(1)
		

Crossrefs

The case of set partitions is A007837.
This is the case of A055887 with all distinct lengths.
For distinct sums instead of lengths we have A336342.
The case of twice-partitions is A358830.
The unordered version is A358836.
The version for constant instead of distinct lengths is A358905.
A000041 counts integer partitions, strict A000009.
A063834 counts twice-partitions.
A141199 counts sequences of partitions with weakly decreasing lengths.

Programs

  • Mathematica
    ptnseq[n_]:=Join@@Table[Tuples[IntegerPartitions/@comp],{comp,Join@@Permutations/@IntegerPartitions[n]}];
    Table[Length[Select[ptnseq[n],UnsameQ@@Length/@#&]],{n,0,10}]
  • PARI
    P(n,y) = {1/prod(k=1, n, 1 - y*x^k + O(x*x^n))}
    seq(n) = {my(g=P(n,y)); [subst(serlaplace(p), y, 1) | p<-Vec(prod(k=1, n, 1 + y*polcoef(g, k, y) + O(x*x^n)))]} \\ Andrew Howroyd, Dec 30 2022

Extensions

Terms a(16) and beyond from Andrew Howroyd, Dec 30 2022

A364406 Number of permutations of [n] such that the minimal element of each cycle is also its length.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 6, 6, 0, 0, 720, 2160, 9360, 19440, 30240, 3659040, 21772800, 228614400, 1632960000, 11125900800, 73025971200, 1708337433600, 15442053580800, 254260755302400, 3318429200486400, 46929444097536000, 546974781889536000, 7312714579602432000
Offset: 0

Views

Author

Alois P. Heinz, Jul 22 2023

Keywords

Examples

			a(0) = 1: () the empty permutation.
a(1) = 1: (1).
a(3) = 1: (1)(23).
a(6) = 6: (1)(24)(356), (1)(24)(365), (1)(25)(346), (1)(25)(364),
  (1)(26)(345), (1)(26)(354).
a(7) = 6: (1)(23)(4567), (1)(23)(4576), (1)(23)(4657), (1)(23)(4675),
  (1)(23)(4756), (1)(23)(4765).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(i*(i+1)/2n+1, 0, b(n-i, i-1)*binomial(n-i, i-1)*(i-1)!)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..33);
  • Mathematica
    b[n_, i_] := b[n, i] = If[i*(i + 1)/2 < n, 0, If[n == 0, 1, b[n, i - 1] + If[2*i > n + 1, 0, b[n - i, i - 1]*Binomial[n - i, i - 1]*(i - 1)!]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 33}] (* Jean-François Alcover, Dec 05 2023, after Alois P. Heinz *)

A182926 Row sums of absolute values of A182928.

Original entry on oeis.org

1, 2, 3, 10, 25, 161, 721, 5706, 40881, 385687, 3628801, 41268613, 479001601, 6324319717, 87212177053, 1317906346186, 20922789888001, 357099708702023, 6402373705728001, 121882752536893635, 2432928081076384321, 51140835669924352717
Offset: 1

Views

Author

Peter Luschny, Apr 16 2011

Keywords

Comments

The sum of multinomial coefficients can be computed recursively as
A005651(0) = 1 and A005651(n) = Sum_{1<=k<=n} binomial(n-1,k-1) * A182926(k) * A005651(n-k).
Möbius inversion yields: 1, 1, 2, 8, 24, 157, 720, 5696, 40878,...
A182927(2*i+1) = A182926(2*i+1).

Examples

			a(6) = 1 + 10 + 30 + 120 = 161.
		

Crossrefs

Programs

  • Maple
    A182926 := proc(n) local d;
    add(n!/(d*((n/d)!)^d),d = numtheory[divisors](n)) end:
    seq(A182926(i), i = 1..22);
  • Mathematica
    a[n_] := Sum[ Abs[ -n!/(d*(-(n/d)!)^d)], {d, Divisors[n]}]; Table[ a[n], {n, 1, 22}] (* Jean-François Alcover, Jul 29 2013 *)

Formula

a(n) = Sum_{d|n} n!/(d*((n/d)!)^d).
E.g.f.: Sum_{k>=1} log(1/(1 - x^k/k!)). - Ilya Gutkovskiy, May 21 2019

A182927 Row sums of A182928.

Original entry on oeis.org

1, 0, 3, -8, 25, -99, 721, -5704, 40881, -340325, 3628801, -41245511, 479001601, -6129725315, 87212177053, -1317906346184, 20922789888001, -354320889234597, 6402373705728001, -121882630320799633, 2432928081076384321, -51041048673495232715
Offset: 1

Views

Author

Peter Luschny, Apr 16 2011

Keywords

Comments

The number of partitions of an n-set with distinct block sizes can
be computed recursively as A007837(0) = 1 and A007837(n) = - Sum_{1<=k<=n} binomial(n-1,k-1) * A182927(k) * A007837(n-k).
Möbius inversion yields: 1, -1, 2, -8, 24, -101, 720, -5696, 40878,...
A182927(2*i+1) = A182926(2*i+1)

Examples

			a(6) = 1 - 10 + 30 - 120 = -99.
		

Crossrefs

Programs

  • Maple
    A182927 := proc(n) local d;
    add(-n! / (d*(-(n/d)!)^d), d = numtheory[divisors](n)) end:
    seq(A182927(i), i = 1..22);
  • Mathematica
    a[n_] := Sum[ -n!/(d*(-(n/d)!)^d), {d, Divisors[n]}]; Table[a[n], {n, 1, 22}] // Flatten (* Jean-François Alcover, Jul 29 2013 *)

Formula

a(n) = Sum_{d|n} -n!/(d*(-(n/d)!)^d).
E.g.f.: Sum_{k>=1} log(1 + x^k/k!). - Ilya Gutkovskiy, May 21 2019

A334370 Expansion of e.g.f. Product_{k>=1} (1 + x^prime(k) / prime(k)!).

Original entry on oeis.org

1, 0, 1, 1, 0, 11, 0, 22, 56, 36, 2640, 1, 8712, 79, 72436, 360465, 48608, 49008961, 794376, 4232764, 7753140, 942565890, 18198334, 14799637777, 10577976, 366619314900, 2785137222400, 1475339135400, 1065920156634060, 3765722000041, 5869315258699050
Offset: 0

Views

Author

Ilya Gutkovskiy, May 11 2020

Keywords

Comments

a(n) is the number of functions f:[n]-> [n] such that the number of elements that are mapped to i is either 0 or the i-th prime. a(5) = 11: (33333), (11222), (12122), (12212), (12221), (21122), (21212), (21221), (22112), (22121), (22211). - Alois P. Heinz, Jul 18 2023

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, b(n, i-1)+
          (p-> `if`(p>n, 0, b(n-p, i-1)*binomial(n, p)))(ithprime(i))))
        end:
    a:= n-> b(n, numtheory[pi](n)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 18 2023
  • Mathematica
    nmax = 30; CoefficientList[Series[Product[(1 + x^Prime[k]/Prime[k]!), {k, 1, nmax}], {x, 0, nmax}], x] Range[0, nmax]!
    a[n_] := a[n] = If[n == 0, 1, (n - 1)! Sum[DivisorSum[k, -#/(-#!)^(k/#) &, PrimeQ[#] &] a[n - k]/(n - k)!, {k, 1, n}]]; Table[a[n], {n, 0, 30}]
  • PARI
    my(N=40, x='x+O('x^N)); Vec(serlaplace(prod(k=1, N, 1+isprime(k)*x^k/k!))) \\ Seiichi Manyama, Feb 27 2022

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

A032312 "EGJ" (unordered, element, labeled) transform of 2,2,2,2...

Original entry on oeis.org

1, 2, 4, 14, 48, 162, 826, 3558, 17296, 101714, 529014, 3218118, 21014010, 140974654, 888205714, 6529087674, 52806013456, 375280736754, 2994842092102, 23821110274230, 217847892367318, 1894959770821614, 16188955616322394, 142246084665611010, 1376483692715941594
Offset: 0

Views

Author

Keywords

Comments

From Peter Bala, Sep 05 2022: (Start)
Conjecture: the Gauss congruences a(n*p^k) == a(n*p^(k-1)) (mod p^k) hold for all primes p and positive integers n and k. Cf. A007837.
Equivalently, the expansion of exp( Sum_{n >= 1} a(n)^x^n/n ) = 1 + 2*x + 4*x^2 + 10*x^3 + 28*x^4 + 82*x^5 + 293*x^6 + ... has integer coefficients. Cf. A168268. (End)

Crossrefs

Programs

  • Mathematica
    With[{nn=30},CoefficientList[Series[Product[(1+x^k/k!)^2,{k,nn}],{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Feb 07 2019 *)
  • PARI
    seq(n)={Vec(serlaplace(prod(k=1, n, (1 + x^k/k! + O(x*x^n))^2)))} \\ Andrew Howroyd, Sep 11 2018

Formula

E.g.f: Product_{k > 0} (1 + x^k/k!)^2. - Andrew Howroyd, Sep 11 2018

Extensions

a(0)=1 prepended and terms a(22) and beyond from Andrew Howroyd, Sep 11 2018

A114902 Number of compositions of {1,..,n} such that no two adjacent parts are of equal size (labeled Carlitz compositions).

Original entry on oeis.org

1, 1, 1, 7, 21, 81, 793, 4929, 33029, 388537, 3751311, 37585989, 523395777, 6814401361, 90789460427, 1486639926417, 24213653736389, 403184436319401, 7665459211898263, 149067938821523349, 2971265450045056871, 64800464138121854877, 1460876941168812354947
Offset: 0

Views

Author

Christian G. Bower, Jan 05 2006

Keywords

Crossrefs

Column k=1 of A261959.

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, 1, add(`if`(i=j, 0, b(n-j,
          `if`(j>n-j, 0, j)) *binomial(n, j)), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..25);  # Alois P. Heinz, Sep 04 2015
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0, 1, Sum[If[i==j, 0, b[n-j, If[j>n-j, 0, j]]* Binomial[n, j]], {j, 1, n}]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 20 2017, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n * n^(n + 1/2), where d = 0.37565358657373546999489873158654700..., c = 2.0427954030382239202983023897265... - Vaclav Kotesovec, Sep 21 2019
Previous Showing 31-40 of 105 results. Next