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

A080337 Bisection of A080107.

Original entry on oeis.org

1, 3, 12, 59, 339, 2210, 16033, 127643, 1103372, 10269643, 102225363, 1082190554, 12126858113, 143268057587, 1778283994284, 23120054355195, 314017850216371, 4444972514600178, 65435496909148513, 999907522895563403, 15832873029742458796, 259377550023571768075
Offset: 1

Views

Author

Wouter Meeussen, Mar 18 2003

Keywords

Comments

Number of symmetric positions of non-attacking rooks on upper-diagonal part of 2n X 2n chessboard.
Number of length-n restricted growth strings (RGS) [s(0),s(1),...,s(n-1)] where s(0)=0 and s(k)<=2+max(prefix) for k>=1, see example. - Joerg Arndt, Apr 25 2010
Number of achiral color patterns in a row or loop of length 2n-1. Two color patterns are equivalent if the colors are permuted. - Robert A. Russell, Apr 24 2018
Stirling transform of A005425(n-1) per Knuth reference. - Robert A. Russell, Apr 28 2018

Examples

			From _Joerg Arndt_, Apr 25 2010: (Start)
For n=0 there is one empty string (term a(0)=0 not included here); for n=1 there is one string [0]; for n=2 there are 3 strings [00], [01], and [02];
for n=3 there are a(3)=12 strings (in lexicographic order):
01: [000],
02: [001],
03: [002],
04: [010],
05: [011],
06: [012],
07: [013],
08: [020],
09: [021],
10: [022],
11: [023],
12: [024].
(End)
For a(3) = 12, both the row and loop patterns are AAAAA, AABAA, ABABA, ABBBA, AABCC, ABACA, ABBBC, ABCAB, ABCBA, ABCBD, ABCDA, and ABCDE. - _Robert A. Russell_, Apr 24 2018
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 765). - Robert A. Russell, Apr 28 2018

Crossrefs

Row sums of A140735.
Column k=2 of A305962.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1,
          add(b(n-1, max(m, j)), j=1..m+2))
        end:
    a:= n-> b(n, -1):
    seq(a(n), n=1..25);  # Alois P. Heinz, Jun 15 2018
  • Mathematica
    Table[Sum[ Binomial[n, k] A002872[[k + 1]], {k, 0, n}], {n, 0, 24}]
    Aodd[m_, k_] := Aodd[m, k] = If[m > 1, k Aodd[m-1, k] + Aodd[m-1, k-1]
      + Aodd[m-1, k-2], Boole[m==1 && k==1]]
    Table[Sum[Aodd[m, k], {k, 1, 2m-1}], {m, 1, 30}] (* Robert A. Russell, Apr 24 2018 *)
    x[n_] := x[n] = If[n<2, n+1, 2x[n-1] + (n-1) x[n-2]]; (* A005425 *)
    Table[Sum[StirlingS2[n, k] x[k-1], {k, 0, n}], {n, 30}] (* Robert A. Russell, Apr 28 2018, after Knuth reference *)
  • PARI
    x='x+O('x^66);
    egf=exp(x+exp(x)+exp(2*x)/2-3/2); /* = 1 +3*x +6*x^2 +59/6*x^3 +113/8*x^4 +... */
    Vec(serlaplace(egf)) /* Joerg Arndt, Apr 29 2011 */

Formula

Binomial transform of A002872 (sorting numbers).
E.g.f.: exp(x+exp(x)+exp(2*x)/2-3/2) = exp(x+sum(j=1,2, (exp(j*x)-1)/j ) ). - Joerg Arndt, Apr 29 2011
From Robert A. Russell, Apr 24 2018: (Start)
Aodd[n,k] = [n>1]*(k*Aodd[n-1,k]+Aodd[n-1,k-1]+Aodd[n-1,k-2])+[n==1]*[k==1]
a(n) = Sum_{k=1..2n-1} Aodd[n,k]. (End)
a(n) = Sum_{k=0..n} Stirling2(n, k)*A005425(k-1). (from Knuth reference) - Robert A. Russell, Apr 28 2018

Extensions

Comment corrected by Wouter Meeussen, Aug 14 2009

A016098 Number of crossing set partitions of {1,2,...,n}.

Original entry on oeis.org

0, 0, 0, 0, 1, 10, 71, 448, 2710, 16285, 99179, 619784, 4005585, 26901537, 188224882, 1373263700, 10444784477, 82735225014, 681599167459, 5830974941867, 51717594114952, 474845349889731, 4506624255883683, 44151662795470696, 445957579390657965
Offset: 0

Views

Author

Keywords

Comments

A partition p of the set N_n = {1,2,...,n}, whose elements are arranged in their natural order, is crossing if there exist four numbers 1 <= i < k < j < l <= n such that i and j are in the same block, k and l are in the same block, but i,j and k,l belong to two different blocks. Noncrossing partitions are also called "planar rhyme schemes". - Peter Luschny, Apr 28 2011
Consider a set of A000217(n) balls of n colors in which, for each integer k = 1 to n, exactly one color appears in the set a total of k times. (Each ball has exactly one color and is indistinguishable from other balls of the same color.) a(n+1) equals the number of ways to choose 0 or more balls of each color while satisfying the following conditions:
1. No two colors are chosen the same positive number of times.
2. Among colors chosen at least once, there exists at least one pair of colors (c, d) such that color c is chosen more times than color d, but color d appears more times in the original set than color c.
If the second requirement is removed, the number of acceptable ways to choose equals A000110(n+1). The number of ways that meet the first requirement, but fail to meet the second, equals A000108(n+1). See related comment for A085082. - Matthew Vandermast, Nov 22 2010
In the May 1978 Scientific American, Martin Gardner mentions Lady Murasaki's The Tale of Genji in which chapter heads illustrate A000110(5) = 52. These are the "crossing" cases mentioned there as being discussed by JoAnne Growney's 1970 thesis. - Alford Arnold, expanded by Charles R Greathouse IV, Jun 21 2021

Examples

			13|24 is the only crossing partition of {1,2,3,4}.
G.f. = x^4 + 10*x^5 + 71*x^6 + 448*x^7 + 2710*x^8 + 16285*x^9 + ...
From _Gus Wiseman_, Feb 15 2019: (Start)
The a(5) = 10 crossing set partitions:
  {{1,2,4},{3,5}}
  {{1,3},{2,4,5}}
  {{1,3,4},{2,5}}
  {{1,3,5},{2,4}}
  {{1,4},{2,3,5}}
  {{1},{2,4},{3,5}}
  {{1,3},{2,4},{5}}
  {{1,3},{2,5},{4}}
  {{1,4},{2},{3,5}}
  {{1,4},{2,5},{3}}
(End)
		

References

  • JoAnne (Simpson) Growney, Structure Inherent in a Free Groupoid, PhD Dissertation, The University of Oklahoma, 1970.

Crossrefs

Programs

  • Magma
    [Bell(n)-Catalan(n): n in [0..25]]; // Vincenzo Librandi, Aug 31 2016
  • Maple
    A016098 := n -> combinat[bell](n) - binomial(2*n,n)/(n+1):
    seq(A016098(n),n=0..22); # Peter Luschny, Apr 28 2011
  • Mathematica
    Table[Sum[StirlingS2[n, k], {k, 0, n}] - Binomial[2*n, n]/(n + 1), {n, 0, 25}] (* T. D. Noe, May 29 2012 *)
    Table[BellB[n] - CatalanNumber[n], {n, 0, 40}] (* Vincenzo Librandi, Aug 31 2016 *)
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    croXQ[stn_]:=MatchQ[stn,{_,{_,x_,_,y_,_},_,{_,z_,_,t_,_},_}/;xGus Wiseman, Feb 17 2019 *)
  • MuPAD
    combinat::bell(n)-combinat::catalan(n) $ n = 0..26 // Zerinvary Lajos, May 10 2008
    
  • Sage
    [bell_number(i)-catalan_number(i) for i in range(23)] # Zerinvary Lajos, Mar 14 2009
    

Formula

a(n) = A000110(n) - A000108(n).
a(n) = Sum_{k=0..n} S2(n,k) - binomial(2*n,n)/(n+1); S2(n,k) Stirling numbers of the second kind.
E.g.f.: exp(exp(x)-1) - (BesselI(0,2*x) - BesselI(1,2*x))*exp(2*x). - Ilya Gutkovskiy, Aug 31 2016

Extensions

Offset corrected by Matthew Vandermast, Nov 22 2010
New name from Peter Luschny, Apr 28 2011

A304972 Triangle read by rows of achiral color patterns (set partitions) for a row or loop of length n. T(n,k) is the number using exactly k colors (sets).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 3, 5, 2, 1, 1, 7, 10, 9, 3, 1, 1, 7, 19, 16, 12, 3, 1, 1, 15, 38, 53, 34, 18, 4, 1, 1, 15, 65, 90, 95, 46, 22, 4, 1, 1, 31, 130, 265, 261, 195, 80, 30, 5, 1, 1, 31, 211, 440, 630, 461, 295, 100, 35, 5, 1, 1, 63, 422, 1221, 1700, 1696, 1016, 515, 155, 45, 6, 1, 1, 63, 665, 2002
Offset: 1

Views

Author

Robert A. Russell, May 22 2018

Keywords

Comments

Two color patterns are equivalent if we permute the colors. Achiral color patterns must be equivalent if we reverse the order of the pattern.

Examples

			Triangle begins:
1;
1,   1;
1,   1,    1;
1,   3,    2,    1;
1,   3,    5,    2,     1;
1,   7,   10,    9,     3,     1;
1,   7,   19,   16,    12,     3,     1;
1,  15,   38,   53,    34,    18,     4,    1;
1,  15,   65,   90,    95,    46,    22,    4,    1;
1,  31,  130,  265,   261,   195,    80,   30,    5,    1;
1,  31,  211,  440,   630,   461,   295,  100,   35,    5,   1;
1,  63,  422, 1221,  1700,  1696,  1016,  515,  155,   45,   6,  1
1,  63,  665, 2002,  3801,  3836,  3156, 1556,  710,  185,  51,  6, 1;
1, 127, 1330, 5369, 10143, 13097, 10508, 6832, 2926, 1120, 266, 63, 7, 1;
For T(4,2)=3, the row patterns are AABB, ABAB, and ABBA.  The loop patterns are AAAB, AABB, and ABAB.
For T(5,3)=5, the color patterns for both rows and loops are AABCC, ABACA, ABBBC, ABCAB, and ABCBA.
		

Crossrefs

Columns 1-6 are A057427, A052551(n-2), A304973, A304974, A304975, A304976.
A305008 has coefficients that determine the function and generating function for each column.
Row sums are A080107.

Programs

  • Mathematica
    Ach[n_, k_] := Ach[n, k] = If[n < 2, Boole[n == k && n >= 0],
      k Ach[n - 2, k] + Ach[n - 2, k - 1] + Ach[n - 2, k - 2]]
    Table[Ach[n, k], {n, 1, 15}, {k, 1, n}] // Flatten
    Ach[n_, k_] := Ach[n, k] = Which[0==k, Boole[0==n], 1==k, Boole[n>0],
      OddQ[n], Sum[Binomial[(n-1)/2, i] Ach[n-1-2i, k-1], {i, 0, (n-1)/2}],
      True, Sum[Binomial[n/2-1, i] (Ach[n-2-2i, k-1]
      + 2^i Ach[n-2-2i, k-2]), {i, 0, n/2-1}]]
    Table[Ach[n, k], {n, 1, 15}, {k, 1, n}] // Flatten
  • PARI
    Ach(n)={my(M=matrix(n,n,i,k,i>=k)); for(i=3, n, for(k=2, n, M[i,k]=k*M[i-2,k] + M[i-2,k-1] + if(k>2, M[i-2,k-2]))); M}
    { my(A=Ach(10)); for(n=1, #A, print(A[n,1..n])) } \\ Andrew Howroyd, Sep 18 2019

Formula

T(n,k) = [n>1] * (k*T(n-2,k) + T(n-2,k-1) + T(n-2,k-2)) + [n<2 & n==k & n>=0].
T(2m-1,k) = A140735(m,k).
T(2m,k) = A293181(m,k).
T(n,k) = [k==0 & n==0] + [k==1 & n>0]
+ [k>1 & n==1 mod 2] * Sum_{i=0..(n-1)/2} (C((n-1)/2, i) * T(n-1-2i, k-1))
+ [k>1 & n==0 mod 2] * Sum_{i=0..(n-2)/2} (C((n-2)/2, i) * (T(n-2-2i, k-1)
+ 2^i * T(n-2-2i, k-2))) where C(n,k) is a binomial coefficient.

A080510 Triangle read by rows: T(n,k) gives the number of set partitions of {1,...,n} with maximum block length k.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 9, 4, 1, 1, 25, 20, 5, 1, 1, 75, 90, 30, 6, 1, 1, 231, 420, 175, 42, 7, 1, 1, 763, 2016, 1015, 280, 56, 8, 1, 1, 2619, 10024, 6111, 1890, 420, 72, 9, 1, 1, 9495, 51640, 38010, 12978, 3150, 600, 90, 10, 1, 1, 35695, 276980, 244035, 91938, 24024, 4950, 825, 110, 11, 1
Offset: 1

Views

Author

Wouter Meeussen, Mar 22 2003

Keywords

Comments

Row sums are A000110 (Bell numbers). Second column is A001189 (Degree n permutations of order exactly 2).
From Peter Luschny, Mar 09 2009: (Start)
Partition product of Product_{j=0..n-1} ((k + 1)*j - 1) and n! at k = -1, summed over parts with equal biggest part (see the Luschny link).
Underlying partition triangle is A036040.
Same partition product with length statistic is A008277.
Diagonal a(A000217) = A000012.
Row sum is A000110. (End)
From Gary W. Adamson, Feb 24 2011: (Start)
Construct an array in which the n-th row is the partition function G(n,k), where G(n,1),...,G(n,6) = A000012, A000085, A001680, A001681, A110038, A148092, with the first few rows
1, 1, 1, 1, 1, 1, 1, ... = A000012
1, 2, 4, 10, 26, 76, 232, ... = A000085
1, 2, 5, 14, 46, 166, 652, ... = A001680
1, 2, 5, 15, 51, 196, 827, ... = A001681
1, 2 5 15 52 202 869, ... = A110038
1, 2, 5 15 52 203 876, ... = A148092
...
Rows tend to A000110, the Bell numbers. Taking finite differences from the top, then reorienting, we obtain triangle A080510.
The n-th row of the array is the eigensequence of an infinite lower triangular matrix with n diagonals of Pascal's triangle starting from the right and the rest zeros. (End)

Examples

			T(4,3) = 4 since there are 4 set partitions with longest block of length 3: {{1},{2,3,4}}, {{1,3,4},{2}}, {{1,2,3},{4}} and {{1,2,4},{3}}.
Triangle begins:
  1;
  1,    1;
  1,    3,     1;
  1,    9,     4,    1;
  1,   25,    20,    5,    1;
  1,   75,    90,   30,    6,   1;
  1,  231,   420,  175,   42,   7,  1;
  1,  763,  2016, 1015,  280,  56,  8,  1;
  1, 2619, 10024, 6111, 1890, 420, 72,  9,  1;
  ...
		

Crossrefs

Columns k=1..10 give: A000012 (for n>0), A001189, A229245, A229246, A229247, A229248, A229249, A229250, A229251, A229252. - Alois P. Heinz, Sep 17 2013
T(2n,n) gives A276961.
Take differences along rows of A229223. - N. J. A. Sloane, Jan 10 2018

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
           add(b(n-i*j, i-1) *n!/i!^j/(n-i*j)!/j!, j=0..n/i)))
        end:
    T:= (n, k)-> b(n, k) -b(n, k-1):
    seq(seq(T(n, k), k=1..n), n=1..12);  # Alois P. Heinz, Apr 20 2012
  • Mathematica
    << DiscreteMath`NewCombinatorica`; Table[Length/@Split[Sort[Max[Length/@# ]&/@SetPartitions[n]]], {n, 12}]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<1, 0, Sum[b[n-i*j, i-1]*n!/i!^j/(n-i*j)!/j!, {j, 0, n/i}]]]; T[n_, k_] := b[n, k]-b[n, k-1]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Feb 25 2014, after Alois P. Heinz *)

Formula

E.g.f. for k-th column: exp(exp(x)*GAMMA(k, x)/(k-1)!-1)*(exp(x^k/k!)-1). - Vladeta Jovovic, Feb 04 2005
From Peter Luschny, Mar 09 2009: (Start)
T(n,0) = [n = 0] (Iverson notation) and for n > 0 and 1 <= m <= n.
T(n,m) = Sum_{a} M(a)|f^a| where a = a_1,...,a_n such that
1*a_1 + 2*a_2 + ... + n*a_n = n and max{a_i} = m, M(a) = n!/(a_1!*...*a_n!),
f^a = (f_1/1!)^a_1*...*(f_n/n!)^a_n and f_n = Product_{j=0..n-1} (-1) = (-1)^n. (End)
From Ludovic Schwob, Jan 15 2022: (Start)
T(2n,n) = C(2n,n)*(A000110(n)-1/2) for n>0.
T(n,m) = C(n,m)*A000110(n-m) for 2m > n > 0. (End)

A002872 Number of partitions of {1..2n} that are invariant under a permutation consisting of n 2-cycles.

Original entry on oeis.org

1, 2, 7, 31, 164, 999, 6841, 51790, 428131, 3827967, 36738144, 376118747, 4086419601, 46910207114, 566845074703, 7186474088735, 95318816501420, 1319330556537631, 19013488408858761, 284724852032757686, 4422344774431494155, 71125541977466879231
Offset: 0

Views

Author

Keywords

Comments

Previous name was: Sorting numbers.
a(n) = number of symmetric partitions of the set {-n,...,-1,1,...,n}. A partition of {-n,...,-1,1,...,n} into nonempty subsets X_1,...,X_k is 'symmetric' if for each i, -X_i=X_j for some j. a(n) = S_B(n,1)+...+S_B(n,n) where S_B(n,k) is as in A085483. a(n) is the n-th Bell number of 'type B'. - James East, Aug 18 2003
Column 2 of A162663. - Franklin T. Adams-Watters, Jul 09 2009
a(n) is equal to the sum of all expressions of the form p(1^n)[st(lambda)] for partitions lambda of order less than or equal to n, where p(1^n)[st(lambda)] denotes the coefficient of the irreducible character basis element indexed by the partition lambda in the expansion of the power sum basis element indexed by the partition (1^n). - John M. Campbell, Sep 16 2017
Number of achiral color patterns in a row or loop of length 2n. Two color patterns are equivalent if the colors are permuted. - Robert A. Russell, Apr 24 2018
Stirling transform of A005425 per Knuth reference. - Robert A. Russell, Apr 28 2018

Examples

			For a(2)=7, the row patterns are AAAA, AABB, ABAB, ABBA, ABBC, ABCA, and ABCD.  The loop patterns are AAAA, AAAB, AABB, AABC, ABAB, ABAC, and ABCD. - _Robert A. Russell_, Apr 24 2018
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 765). - Robert A. Russell, Apr 28 2018
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

u[n,j] is A162663.
Row sums of A293181.
Column k=2 of A306024.
Cf. A005425.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add((1+
          2^(j-1))*binomial(n-1, j-1)*a(n-j), j=1..n))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 29 2015
  • Mathematica
    u[0,j_]:=1;u[k_,j_]:=u[k,j]=Sum[Binomial[k-1,i-1]Plus@@(u[k-i,j]#^(i-1)&/@Divisors[j]),{i,k}]; Table[u[n,2],{n,0,12}] (* Wouter Meeussen, Dec 06 2008 *)
    mx = 16; p = 2; Range[0, mx]! CoefficientList[ Series[ Exp[ (Exp[p*x] - p - 1)/p + Exp[x]], {x, 0, mx}], x] (* Robert G. Wilson v, Dec 12 2012 *)
    Aeven[m_, k_] := Aeven[m, k] = If[m>0, k Aeven[m-1, k] + Aeven[m-1, k-1]
      + Aeven[m-1, k-2], Boole[m==0 && k==0]]
    Table[Sum[Aeven[m, k], {k, 0, 2m}], {m, 0, 30}] (* Robert A. Russell, Apr 24 2018 *)
    x[n_] := x[n] = If[n<2, n+1, 2x[n-1] + (n-1)x[n-2]]; (* A005425 *)
    Table[Sum[StirlingS2[n, k] x[k], {k, 0, n}], {n, 0, 20}] (* Robert A. Russell, Apr 28 2018, from Knuth reference *)
    Table[Sum[Binomial[n,k] * 2^k * BellB[k, 1/2] * BellB[n-k], {k, 0, n}], {n, 0, 20}] (* Vaclav Kotesovec, Jun 29 2022 *)

Formula

E.g.f.: e^( (e^(2x) - 3)/2 + e^x ).
a(n) = A080107(2n) for all n. - Jörgen Backelin, Jan 13 2016
From Robert A. Russell, Apr 24 2018: (Start)
Aeven(n,k) = [n>0]*(k*Aeven(n-1,k)+Aeven(n-1,k-1)+Aeven(n-1,k-2))
+ [n==0]*[k==0]
a(n) = Sum_{k=0..2n} Aeven(n,k). (End)
a(n) = Sum_{k=0..n} Stirling2(n, k)*A005425(k). (from Knuth reference) - Robert A. Russell, Apr 28 2018
a(n) ~ exp(exp(2*r)/2 + exp(r) - 3/2 - n) * (n/r)^(n + 1/2) / sqrt((1 + 2*r)*exp(2*r) + (1 + r)*exp(r)), where r = LambertW(2*n)/2 - 1/(1 + 2/LambertW(2*n) + n^(1/2) * (1 + LambertW(2*n)) * (2/LambertW(2*n))^(3/2)). - Vaclav Kotesovec, Jul 03 2022
a(n) ~ (2*n/LambertW(2*n))^n * exp(n/LambertW(2*n) + (2*n/LambertW(2*n))^(1/2) - n - 7/4) / sqrt(1 + LambertW(2*n)). - Vaclav Kotesovec, Jul 10 2022

Extensions

Edited by Franklin T. Adams-Watters, Jul 09 2009

A124323 Triangle read by rows: T(n,k) is the number of partitions of an n-set having k singleton blocks (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 3, 0, 1, 4, 4, 6, 0, 1, 11, 20, 10, 10, 0, 1, 41, 66, 60, 20, 15, 0, 1, 162, 287, 231, 140, 35, 21, 0, 1, 715, 1296, 1148, 616, 280, 56, 28, 0, 1, 3425, 6435, 5832, 3444, 1386, 504, 84, 36, 0, 1, 17722, 34250, 32175, 19440, 8610, 2772, 840, 120, 45, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, Oct 28 2006

Keywords

Comments

Row sums are the Bell numbers (A000110). T(n,0)=A000296(n). T(n,k) = binomial(n,k)*T(n-k,0). Sum(k*T(n,k),k=0..n) = A052889(n) = n*B(n-1), where B(q) are the Bell numbers (A000110).
Exponential Riordan array [exp(exp(x)-1-x),x]. - Paul Barry, Apr 23 2009
Sum_{k=0..n} T(n,k)*2^k = A000110(n+1) is the number of binary relations on an n-set that are both symmetric and transitive. - Geoffrey Critzer, Jul 25 2014
Also the number of set partitions of {1, ..., n} with k cyclical adjacencies (successive elements in the same block, where 1 is a successor of n). Unlike A250104, we count {{1}} as having 1 cyclical adjacency. - Gus Wiseman, Feb 13 2019

Examples

			T(4,2)=6 because we have 12|3|4, 13|2|4, 14|2|3, 1|23|4, 1|24|3 and 1|2|34 (if we take {1,2,3,4} as our 4-set).
Triangle starts:
     1
     0    1
     1    0    1
     1    3    0    1
     4    4    6    0    1
    11   20   10   10    0    1
    41   66   60   20   15    0    1
   162  287  231  140   35   21    0    1
   715 1296 1148  616  280   56   28    0    1
  3425 6435 5832 3444 1386  504   84   36    0    1
From _Gus Wiseman_, Feb 13 2019: (Start)
Row n = 5 counts the following set partitions by number of singletons:
  {{1234}}    {{1}{234}}  {{1}{2}{34}}  {{1}{2}{3}{4}}
  {{12}{34}}  {{123}{4}}  {{1}{23}{4}}
  {{13}{24}}  {{124}{3}}  {{12}{3}{4}}
  {{14}{23}}  {{134}{2}}  {{1}{24}{3}}
                          {{13}{2}{4}}
                          {{14}{2}{3}}
... and the following set partitions by number of cyclical adjacencies:
  {{13}{24}}      {{1}{2}{34}}  {{1}{234}}  {{1234}}
  {{1}{24}{3}}    {{1}{23}{4}}  {{12}{34}}
  {{13}{2}{4}}    {{12}{3}{4}}  {{123}{4}}
  {{1}{2}{3}{4}}  {{14}{2}{3}}  {{124}{3}}
                                {{134}{2}}
                                {{14}{23}}
(End)
From _Paul Barry_, Apr 23 2009: (Start)
Production matrix is
0, 1,
1, 0, 1,
1, 2, 0, 1,
1, 3, 3, 0, 1,
1, 4, 6, 4, 0, 1,
1, 5, 10, 10, 5, 0, 1,
1, 6, 15, 20, 15, 6, 0, 1,
1, 7, 21, 35, 35, 21, 7, 0, 1,
1, 8, 28, 56, 70, 56, 28, 8, 0, 1 (End)
		

Crossrefs

A250104 is an essentially identical triangle, differing only in row 1.
For columns see A000296, A250105, A250106, A250107.

Programs

  • Maple
    G:=exp(exp(z)-1+(t-1)*z): Gser:=simplify(series(G,z=0,14)): for n from 0 to 11 do P[n]:=sort(n!*coeff(Gser,z,n)) od: for n from 0 to 11 do seq(coeff(P[n],t,k),k=0..n) od; # yields sequence in triangular form
    # Program from R. J. Mathar, Jan 22 2015:
    A124323 := proc(n,k)
        binomial(n,k)*A000296(n-k) ;
    end proc:
  • Mathematica
    Flatten[CoefficientList[Range[0,10]! CoefficientList[Series[Exp[x y] Exp[Exp[x] - x - 1], {x, 0,10}], x], y]] (* Geoffrey Critzer, Nov 24 2011 *)
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[Range[n]],Count[#,{}]==k&]],{n,0,9},{k,0,n}] (* _Gus Wiseman, Feb 13 2019 *)

Formula

T(n,k) = binomial(n,k)*[(-1)^(n-k)+sum((-1)^(j-1)*B(n-k-j), j=1..n-k)], where B(q) are the Bell numbers (A000110).
E.g.f.: G(t,z) = exp(exp(z)-1+(t-1)*z).
G.f.: 1/(1-xy-x^2/(1-xy-x-2x^2/(1-xy-2x-3x^2/(1-xy-3x-4x^2/(1-... (continued fraction). - Paul Barry, Apr 23 2009

A084423 Set partitions up to rotations.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 43, 127, 544, 2361, 11703, 61690, 351773, 2126497, 13639372, 92197523, 655035769, 4874404108, 37893370473, 306986431847, 2586209749712, 22612848403571, 204850732480285, 1919652428481930, 18581619724363401, 185543613289200949
Offset: 0

Views

Author

Wouter Meeussen, Jun 26 2003

Keywords

Comments

Partitions of n objects distinct under the cyclic group, C_n. By comparison the partition numbers (A000041) are the partitions distinct under the symmetric group, S_n and the set partitions are those distinct under the discrete group containing only the identity. - Franklin T. Adams-Watters, Jun 09 2008
Equivalently, number of n-bead necklaces using any number of unlabeled (interchangable) colors. - Andrew Howroyd, Sep 25 2017

Examples

			Of the Bell(4) = 15 set partitions of 4, only 7 remain distinct under rotation:
  {{1,2,3,4}},
  {{1}, {2,3,4}},
  {{1,2}, {3,4}},
  {{1,3}, {2,4}},
  {{1}, {2}, {3,4}},
  {{1}, {3}, {2,4}},
  {{1}, {2}, {3}, {4}}.
		

Crossrefs

Programs

  • Mathematica
    <Mod[i+1, n, 1])]&, #, n]]]& /@ SetPartitions[n]]; Table[ Length[ shrink[k]], {k, 11}]
    (* Second program (not needing Combinatorica): *)
    u[0, ] = 1; u[k, j_] := u[k, j] = Sum[Binomial[k-1, i-1]*Sum[u[k-i, j]*d^(i-1), {d, Divisors[j]}], {i, 1, k}]; a[n_] := Sum[EulerPhi[j]*u[n/j, j], {j, Divisors[n]}]/n; a[0] = 1; Table[a[n], {n, 0, 24}] (* Jean-François Alcover, May 14 2012, after Franklin T. Adams-Watters *)
  • PARI
    U(k, j) = if(k==0,1,sum(i=1,k,binomial(k-1,i-1)*sumdiv(j,d,U(k-i,j) *d^(i-1)))) /* U is unoptimized; should remember previous values. */
    a(n) = sumdiv(n,j,eulerphi(j)*U(n\j,j))/n \\ Franklin T. Adams-Watters, Jun 09 2008
    
  • PARI
    seq(n)={Vec(1 + intformal(sum(m=1, n, eulerphi(m)*subst(serlaplace(-1 + exp(sumdiv(m, d, (exp(d*x + O(x*x^(n\m)))-1)/d))), x, x^m))/x))} \\ Andrew Howroyd, Sep 20 2019

Formula

a(p) = (Bell(p)+2*(p-1))/p for prime p; cf. A079609. - Vladeta Jovovic, Jul 04 2003
U(k,j) = 1 if k=0, else Sum_{i=1..k} C(k-1,i-1) Sum_{d|j} U(k-i,j)*d^{i-1}. Then a(n) = (Sum_{j|n} phi(j)*U(n/j,j))/n. (U(k,j) is the number of partitions invariant under a permutation with k cycles of j objects each.) - Franklin T. Adams-Watters, Jun 09 2008
a(n) = [n==0] + [n>0] * (1/n) * Sum_{d|n} phi(d) * A162663(n/d,d). - Robert A. Russell, Jun 10 2018
From Richard L. Ollerton, May 09 2021: (Start)
For n >= 1:
a(n) = (1/n)*Sum_{k=1..n} A162663(gcd(n,k),n/gcd(n,k)).
a(n) = (1/n)*Sum_{k=1..n} A162663(n/gcd(n,k),gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). (End)

Extensions

More terms from Robert G. Wilson v, Jun 27 2003
More terms from Franklin T. Adams-Watters, Jun 09 2008

A103293 Number of ways to color n regions arranged in a line such that consecutive regions do not have the same color.

Original entry on oeis.org

1, 1, 1, 2, 4, 11, 32, 117, 468, 2152, 10743, 58487, 340390, 2110219, 13830235, 95475556, 691543094, 5240285139, 41432986588, 341040317063, 2916376237350, 25862097486758, 237434959191057, 2253358057283035, 22076003468637450, 222979436690612445
Offset: 0

Views

Author

Hugo van der Sanden, Mar 10 2005

Keywords

Comments

From David W. Wilson, Mar 10 2005: (Start)
Let M(n) be a map of n regions in a row. The number of ways to color M(n) if same-color regions are allowed to touch is given by A000110(n).
For example, M(4) has A000110(4) = 15 such colorings: aaaa aaab aaba aabb aabc abaa abab abac abba abbb abbc abca abcb abcc abcd.
The number of colorings of M(n) that are equivalent to their reverse is given by A080107(n). For example, M(4) has A080107(4) = 7 colorings that are equivalent to their reversal: aaaa aabb abab abba abbc abca abcd.
The number of distinct colorings when reversals are counted as equivalent is given by (A000110(n) + A080107(n))/2, which is essentially the present sequence. M(4) has 11 colorings that are distinct up to reversal: aaaa aaab aaba aabb aabc abab abac abba abbc abca abcd.
We can redo the whole analysis, this time forbidding same-color regions to touch. When we do, we get the same sequences, each with an extra 1 at the beginning. (End)
Note that A056325 gives the number of reversible string structures with n beads using a maximum of six different colors ... and, of course, any limit on the number of colors will be the same as this sequence above up to that number.
If the two ends of the line are distinguishable, so that 'abcb' and 'abac' are distinct, we get the Bell numbers, A000110(n - 1).
With a different offset, number of set partitions of [n] up to reflection (i<->n+1-i). E.g., there are 4 partitions of [3]: 123, 1-23, 13-2, 1-2-3 but not 12-3 because it is the reflection of 1-23. - David Callan, Oct 10 2005

Examples

			For n=4, possible arrangements are 'abab', 'abac', 'abca', 'abcd'; we do not include 'abcb' since it is equivalent to 'abac' (if you reverse and renormalize).
		

Crossrefs

The numbers of unlabeled k-paths for k = 2..7 are given in A005418, A001998, A056323, A056324, A056325, and A345207, respectively (these are also columns of the array in A320750). The sequences counting the unlabeled k-paths converge to this sequence when k goes to infinity.
Row sums of A284949.

Programs

  • Maple
    with(combinat): b:= n-> coeff(series(exp((exp(2*x)-3)/2+exp(x)), x, n+1), x,n)*n!: a:= n-> `if`(n=0, 1, (bell(n-1) +`if`(modp(n,2)=1, b((n-1)/2), add(binomial(n/2-1,k) *b(k), k=0..n/2-1)))/2): seq(a(n), n=0..30); # Alois P. Heinz, Sep 05 2008
  • Mathematica
    b[n_] := SeriesCoefficient[Exp[(Exp[2*x] - 3)/2 + Exp[x]], {x, 0, n}]*n!; a[n_] := If[n == 0, 1, (BellB[n - 1] + If[Mod[n, 2] == 1, b[(n - 1)/2], Sum[Binomial[n/2 - 1, k] *b[k], {k, 0, n/2 - 1}]])/2]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jan 17 2016, after Alois P. Heinz *)
    Ach[n_, k_] := Ach[n, k] = If[n<2, Boole[n==k && n>=0],
       k Ach[n-2, k] + Ach[n-2, k-1] + Ach[n-2, k-2]] (* achiral *)
    Table[Sum[(StirlingS2[n-1, k] + Ach[n-1, k])/2, {k, 0, n-1}], {n, 1, 30}]
    (* with a(0) omitted - Robert A. Russell, May 19 2018 *)
  • Python
    from functools import lru_cache
    from sympy.functions.combinatorial.numbers import stirling
    def A103293(n):
        if n == 0: return 1
        @lru_cache(maxsize=None)
        def ach(n,k): return (n==k) if n<2 else k*ach(n-2,k)+ach(n-2,k-1)+ach(n-2,k-2)
        return sum(stirling(n-1,k,kind=2)+ach(n-1,k)>>1 for k in range(n)) # Chai Wah Wu, Oct 15 2024

Formula

a(n) = Sum_{k=0..n-1} (Stirling2(n-1,k) + Ach(n-1,k))/2 for n>0, where Ach(n,k) = [n>1] * (k*Ach(n-2,k) + Ach(n-2,k-1) + Ach(n-2,k-2)) + [n<2 & n>=0 & n==k]. - Robert A. Russell, May 19 2018

Extensions

More terms from David W. Wilson, Mar 10 2005

A125810 Triangle of q-Bell number coefficients, read by rows that form polynomials in q, giving the eigensequence for the triangle of q-binomial coefficients.

Original entry on oeis.org

1, 1, 2, 4, 1, 8, 4, 3, 16, 12, 13, 8, 3, 32, 32, 42, 38, 33, 15, 10, 1, 64, 80, 120, 133, 145, 121, 98, 60, 37, 15, 4, 128, 192, 320, 408, 507, 526, 544, 457, 391, 281, 195, 104, 61, 20, 6, 256, 448, 816, 1160, 1585, 1875, 2189, 2259, 2256, 2066, 1819, 1450, 1133, 777, 506, 300, 158, 65, 25, 4
Offset: 0

Views

Author

Paul D. Hanna, Dec 10 2006

Keywords

Comments

Row n evaluated at sample values of q are as follows:
R_n(q=1) = A000110(n) (Bell numbers);
R_n(q=-1) = A080107(n) (fixed points of permutation of SetPartitions);
R_n(q=2) = A125812; R_n(q=3) = A125813; R_n(q=4) = A125814; R_n(q=5) = A125815.
T(n,k) is the number of set partitions of [n] having exactly k inversions. T(5,4)=3: 145|23, 145|2|3, 15|24|3; T(6,6) = 10: 1456|23, 156|234, 156|23|4, 1456|2|3, 146|25|3, 16|245|3, 156|2|34, 16|25|34, 156|2|3|4, 16|25|3|4. - Alois P. Heinz, Apr 03 2016

Examples

			Row g.f.s B_q(n) are polynomials in q generated by:
B_q(n) = Sum_{j=0..n-1} B_q(j) * C_q(n-1,j) for n>0 with B_q(0)=1
where the triangle of q-binomial coefficients C_q(n,k) begins:
1;
1, 1;
1, 1 + q, 1;
1, 1 + q + q^2, 1 + q + q^2, 1;
1, 1 + q + q^2 + q^3, 1 + q + 2*q^2 + q^3 + q^4, 1 + q + q^2 + q^3, 1;
The initial q-Bell coefficients in B_q(n) are:
B_q(0) = 1; B_q(1) = 1; B_q(2) = 2;
B_q(3) = 4 + q;
B_q(4) = 8 + 4*q + 3*q^2;
B_q(5) = 16 + 12*q + 13*q^2 + 8*q^3 + 3*q^4;
B_q(6) = 32 + 32*q + 42*q^2 + 38*q^3 + 33*q^4 + 15*q^5 + 10*q^6 + q^7.
Number of terms in row n is given by A125811, which starts:
1,1,1,2,3,5,8,11,15,20,26,32,39,47,56,66,76,87,99,112,126,141,156,...
Triangle begins:
    1;
    1;
    2;
    4,   1;
    8,   4,   3;
   16,  12,  13,    8,    3;
   32,  32,  42,   38,   33,   15,   10,    1;
   64,  80, 120,  133,  145,  121,   98,   60,   37,   15,    4;
  128, 192, 320,  408,  507,  526,  544,  457,  391,  281,  195,  104,   61,  20, 6;
  256, 448, 816, 1160, 1585, 1875, 2189, 2259, 2256, 2066, 1819, 1450, 1133, 777, 506, 300, 158, 65, 25, 4;
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(o, u, t) option remember; expand(
         `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2), 0)+add(x^(u+j-1)*
            b(o-j, u+j-1, min(2, t+1)), j=`if`(t=0, 1, 1..o))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Feb 21 2025
  • Mathematica
    QB[n_, q_] := QB[n, q] = Sum[QB[j, q] QBinomial[n-1, j, q], {j, 0, n-1}] // FunctionExpand // Simplify; QB[0, q_]=1; QB[1, q_]=1; Table[ CoefficientList[QB[n, q], q], {n, 0, 9}] // Flatten (* Jean-François Alcover, Feb 29 2016 *)
  • PARI
    /* q-Binomial coefficients: */
    {C_q(n, k) = if(n
    				

Formula

T(n,0) = 2^(n-1) for n>0. G.f. of row n is a polynomial in q, B_q(n), that is generated by the recurrence: B_q(n) = Sum_{j=0..n-1} B_q(j) * C_q(n-1,j) for n>0, with B_q(0)=1. The q-binomial coefficient (also called Gaussian binomial coefficient) is given by: C_q(n,k) = [Product_{i=n-k+1..n} (1-q^i)]/[Product_{j=1..k} (1-q^j)].
Sum_{k>0} k * T(n,k) = A264082(n). - Alois P. Heinz, Apr 03 2016

A305749 T(n,k) is the number of achiral color patterns (set partitions) in a row or loop of length n with k or fewer colors (sets).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 4, 1, 1, 2, 3, 6, 4, 1, 1, 2, 3, 7, 9, 8, 1, 1, 2, 3, 7, 11, 18, 8, 1, 1, 2, 3, 7, 12, 27, 27, 16, 1, 1, 2, 3, 7, 12, 30, 43, 54, 16, 1, 1, 2, 3, 7, 12, 31, 55, 107, 81, 32, 1, 1, 2, 3, 7, 12, 31, 58, 141, 171, 162, 32, 1, 1, 2, 3, 7, 12, 31, 59, 159, 266, 427, 243, 64, 1, 1, 2, 3, 7, 12, 31, 59, 163, 312, 688, 683, 486, 64, 1
Offset: 1

Views

Author

Robert A. Russell, Jun 09 2018

Keywords

Comments

An equivalent color pattern is obtained when we permute the colors. Thus all permutations of ABC are equivalent, as are AAABB and BBBAA. A color pattern is achiral if it is equivalent to its reversal. Rotations of the colors of a loop are equivalent, so for loops AAABCB = BAAABC = CBAAAB.

Examples

			The array begins at T(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 ...
1  2   3    3    3     3     3     3     3     3     3     3     3 ...
1  4   6    7    7     7     7     7     7     7     7     7     7 ...
1  4   9   11   12    12    12    12    12    12    12    12    12 ...
1  8  18   27   30    31    31    31    31    31    31    31    31 ...
1  8  27   43   55    58    59    59    59    59    59    59    59 ...
1 16  54  107  141   159   163   164   164   164   164   164   164 ...
1 16  81  171  266   312   334   338   339   339   339   339   339 ...
1 32 162  427  688   883   963   993   998   999   999   999   999 ...
1 32 243  683 1313  1774  2069  2169  2204  2209  2210  2210  2210 ...
1 64 486 1707 3407  5103  6119  6634  6789  6834  6840  6841  6841 ...
1 64 729 2731 6532 10368 13524 15080 15790 15975 16026 16032 16033 ...
a(n) are the terms of this array read by antidiagonals.
For T(4,3)=6, the achiral pattern rows are AAAA, AABB, ABAB, ABBA, ABBC, and ABCA. The achiral pattern loops are AAAA, AAAB, AABB, ABAB, AABC, and ABAC.
		

Crossrefs

Columns 1-6 are A057427, A016116, A182522, A305750, A305751, and A305752.
Columns converge to the right to A080107.

Programs

  • Mathematica
    Ach[n_, k_] := Ach[n,k] = If[n<2, Boole[n==k && n>=0], k Ach[n-2,k] +
      Ach[n-2,k-1] + Ach[n-2,k-2]]; (* A304972 *)
    Table[Sum[Ach[n, j], {j, 1, k - n + 1}], {k, 1, 15}, {n, 1, k}] // Flatten

Formula

T(n,k) = Sum_{j=0..k} Ach(n,j), where Ach(n,k) = [n>1] * (k*T(n-2,k) + T(n-2,k-1) + T(n-2,k-2)) + [0 <= n <= 1 & n==k].
T(n,k) = Sum_{j=1..k} A304972(n,j).
Showing 1-10 of 17 results. Next