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 10 results.

A000071 a(n) = Fibonacci(n) - 1.

Original entry on oeis.org

0, 0, 1, 2, 4, 7, 12, 20, 33, 54, 88, 143, 232, 376, 609, 986, 1596, 2583, 4180, 6764, 10945, 17710, 28656, 46367, 75024, 121392, 196417, 317810, 514228, 832039, 1346268, 2178308, 3524577, 5702886, 9227464, 14930351, 24157816, 39088168, 63245985, 102334154
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of allowable transition rules for passing from one change to the next (on n-1 bells) in the English art of bell-ringing. This is also the number of involutions in the symmetric group S_{n-1} which can be represented as a product of transpositions of consecutive numbers from {1, 2, ..., n-1}. Thus for n = 6 we have a(6) from (12), (12)(34), (12)(45), (23), (23)(45), (34), (45), for instance. See my 1983 Math. Proc. Camb. Phil. Soc. paper. - Arthur T. White, letter to N. J. A. Sloane, Dec 18 1986
Number of permutations p of {1, 2, ..., n-1} such that max|p(i) - i| = 1. Example: a(4) = 2 since only the permutations 132 and 213 of {1, 2, 3} satisfy the given condition. - Emeric Deutsch, Jun 04 2003 [For a(5) = 4 we have 2143, 1324, 2134 and 1243. - Jon Perry, Sep 14 2013]
Number of 001-avoiding binary words of length n-3. a(n) is the number of partitions of {1, ..., n-1} into two blocks in which only 1- or 2-strings of consecutive integers can appear in a block and there is at least one 2-string. E.g., a(6) = 7 because the enumerated partitions of {1, 2, 3, 4, 5} are 124/35, 134/25, 14/235, 13/245, 1245/3, 145/23, 125/34. - Augustine O. Munagi, Apr 11 2005
Numbers for which only one Fibonacci bit-representation is possible and for which the maximal and minimal Fibonacci bit-representations (A104326 and A014417) are equal. For example, a(12) = 10101 because 8 + 3 + 1 = 12. - Casey Mongoven, Mar 19 2006
Beginning with a(2), the "Recamán transform" (see A005132) of the Fibonacci numbers (A000045). - Nick Hobson, Mar 01 2007
Starting with nonzero terms, a(n) gives the row sums of triangle A158950. - Gary W. Adamson, Mar 31 2009
a(n+2) is the minimum number of elements in an AVL tree of height n. - Lennert Buytenhek (buytenh(AT)wantstofly.org), May 31 2010
a(n) is the number of branch nodes in the Fibonacci tree of order n-1. A Fibonacci tree of order n (n >= 2) is a complete binary tree whose left subtree is the Fibonacci tree of order n-1 and whose right subtree is the Fibonacci tree of order n-2; each of the Fibonacci trees of order 0 and 1 is defined as a single node (see the Knuth reference, p. 417). - Emeric Deutsch, Jun 14 2010
a(n+3) is the number of distinct three-strand positive braids of length n (cf. Burckel). - Maxime Bourrigan, Apr 04 2011
a(n+1) is the number of compositions of n with maximal part 2. - Joerg Arndt, May 21 2013
a(n+2) is the number of leafs of great-grandparent DAG (directed acyclic graph) of height n. A great-grandparent DAG of height n is a single node for n = 1; for n > 1 each leaf of ggpDAG(n-1) has two child nodes where pairs of adjacent new nodes are merged into single node if and only if they have disjoint grandparents and same great-grandparent. Consequence: a(n) = 2*a(n-1) - a(n-3). - Hermann Stamm-Wilbrandt, Jul 06 2014
2 and 7 are the only prime numbers in this sequence. - Emmanuel Vantieghem, Oct 01 2014
From Russell Jay Hendel, Mar 15 2015: (Start)
We can establish Gerald McGarvey's conjecture mentioned in the Formula section, however we require n > 4. We need the following 4 prerequisites.
(1) a(n) = F(n) - 1, with {F(n)}A000045.%20(2)%20(Binet%20form)%20F(n)%20=%20(d%5En%20-%20e%5En)/sqrt(5)%20with%20d%20=%20phi%20and%20e%20=%201%20-%20phi,%20de%20=%20-1%20and%20d%20+%20e%20=%201.%20It%20follows%20that%20a(n)%20=%20(d(n)%20-%20e(n))/sqrt(5)%20-%201.%20(3)%20To%20prove%20floor(x)%20=%20y%20is%20equivalent%20to%20proving%20that%20x%20-%20y%20lies%20in%20the%20half-open%20interval%20%5B0,%201).%20(4)%20The%20series%20%7Bs(n)%20=%20c1%20x%5En%20+%20c2%7D">{n >= 1} the Fibonacci numbers A000045. (2) (Binet form) F(n) = (d^n - e^n)/sqrt(5) with d = phi and e = 1 - phi, de = -1 and d + e = 1. It follows that a(n) = (d(n) - e(n))/sqrt(5) - 1. (3) To prove floor(x) = y is equivalent to proving that x - y lies in the half-open interval [0, 1). (4) The series {s(n) = c1 x^n + c2}{n >= 1}, with -1 < x < 0, and c1 and c2 positive constants, converges by oscillation with s(1) < s(3) < s(5) < ... < s(6) < s(4) < s(2). If follows that for any odd n, the open interval (s(n), s(n+1)) contains the subsequence {s(t)}_{t >= n + 2}. Using these prerequisites we can analyze the conjecture.
Using prerequisites (2) and (3) we see we must prove, for all n > 4, that d((d^(n-1) - e^(n-1))/sqrt(5) - 1) - (d^n - e^n)/sqrt(5) + 1 + c lies in the interval [0, 1). But de = -1, implying de^(n-1) = -e^(n-2). It follows that we must equivalently prove (for all n > 4) that E(n, c) = (e^(n-2) + e^n)/sqrt(5) + 1 - d + c = e^(n-2) (e^2 + 1)/sqrt(5) + e + c lies in [0, 1). Clearly, for any particular n, E(n, c) has extrema (maxima, minima) when c = 2*(1-d) and c = (1+d)*(1-d). Therefore, the proof is completed by using prerequisite (4). It suffices to verify E(5, 2*(1-d)) = 0, E(6, 2*(1-d)) = 0.236068, E(5, (1-d)*(1+d)) = 0.618034, E(6, (1-d)*(1+d)) = 0.854102, all lie in [0, 1).
(End)
a(n) can be shown to be the number of distinct nonempty matchings on a path with n vertices. (A matching is a collection of disjoint edges.) - Andrew Penland, Feb 14 2017
Also, for n > 3, the lexicographically earliest sequence of positive integers such that {phi*a(n)} is located strictly between {phi*a(n-1)} and {phi*a(n-2)}. - Ivan Neretin, Mar 23 2017
From Eric M. Schmidt, Jul 17 2017: (Start)
Number of sequences (e(1), ..., e(n-2)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) != e(j) <= e(k). [Martinez and Savage, 2.5]
Number of sequences (e(1), ..., e(n-2)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) >= e(j) <= e(k) and e(i) != e(k). [Martinez and Savage, 2.5]
(End)
Numbers whose Zeckendorf (A014417) and dual Zeckendorf (A104326) representations are the same: alternating digits of 1 and 0. - Amiram Eldar, Nov 01 2019
a(n+2) is the length of the longest array whose local maximum element can be found in at most n reveals. See link to the puzzle by Alexander S. Kulikov. - Dmitry Kamenetsky, Aug 08 2020
a(n+2) is the number of nonempty subsets of {1,2,...,n} that contain no consecutive elements. For example, the a(6)=7 subsets of {1,2,3,4} are {1}, {2}, {3}, {4}, {1,3}, {1,4} and {2,4}. - Muge Olucoglu, Mar 21 2021
a(n+3) is the number of allowed patterns of length n in the even shift (that is, a(n+3) is the number of binary words of length n in which there are an even number of 0s between any two occurrences of 1). For example, a(7)=12 and the 12 allowed patterns of length 4 in the even shift are 0000, 0001, 0010, 0011, 0100, 0110, 0111, 1000, 1001, 1100, 1110, 1111. - Zoran Sunic, Apr 06 2022
Conjecture: for k a positive odd integer, the sequence {a(k^n): n >= 1} is a strong divisibility sequence; that is, for n, m >= 1, gcd(a(k^n), a(k^m)) = a(k^gcd(n,m)). - Peter Bala, Dec 05 2022
In general, the sum of a second-order linear recurrence having signature (c,d) will be a third-order recurrence having a signature (c+1,d-c,-d). - Gary Detlefs, Jan 05 2023
a(n) is the number of binary strings of length n-2 whose longest run of 1's is of length 1, for n >= 3. - Félix Balado, Apr 03 2025

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 1.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 28.
  • M. Kauers and P. Paule, The Concrete Tetrahedron, Springer 2011, p. 64.
  • D. E. Knuth, The Art of Computer Programming, Vol. 3, 2nd edition, Addison-Wesley, Reading, MA, 1998, p. 417.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 155.
  • 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).
  • J. L. Yucas, Counting special sets of binary Lyndon words, Ars Combin., 31 (1991), 21-29.

Crossrefs

Antidiagonal sums of array A004070.
Right-hand column 2 of triangle A011794.
Related to sum of Fibonacci(kn) over n. Cf. A099919, A058038, A138134, A053606.
Subsequence of A226538. Also a subsequence of A061489.

Programs

  • Haskell
    a000071 n = a000071_list !! n
    a000071_list = map (subtract 1) $ tail a000045_list
    -- Reinhard Zumkeller, May 23 2013
    
  • Magma
    [Fibonacci(n)-1: n in [1..60]]; // Vincenzo Librandi, Apr 04 2011
    
  • Maple
    A000071 := proc(n) combinat[fibonacci](n)-1 ; end proc; # R. J. Mathar, Apr 07 2011
    a:= n-> (Matrix([[1, 1, 0], [1, 0, 0], [1, 0, 1]])^(n-1))[3, 2]; seq(a(n), n=1..50); # Alois P. Heinz, Jul 24 2008
  • Mathematica
    Fibonacci[Range[40]] - 1 (* or *) LinearRecurrence[{2, 0, -1}, {0, 0, 1}, 40] (* Harvey P. Dale, Aug 23 2013 *)
    Join[{0}, Accumulate[Fibonacci[Range[0, 39]]]] (* Alonso del Arte, Oct 22 2017, based on Giorgi Dalakishvili's formula *)
  • PARI
    {a(n) = if( n<1, 0, fibonacci(n)-1)};
    
  • SageMath
    [fibonacci(n)-1 for n in range(1,60)] # G. C. Greubel, Oct 21 2024

Formula

a(n) = A000045(n) - 1.
a(0) = -1, a(1) = 0; thereafter a(n) = a(n-1) + a(n-2) + 1.
a(n) = A101220(1, 1, n-2), for n > 1.
G.f.: x^3/((1-x-x^2)*(1-x)). - Simon Plouffe in his 1992 dissertation, dropping initial 0's
a(n) = 2*a(n-1) - a(n-3). - R. H. Hardin, Apr 02 2011
Partial sums of Fibonacci numbers. - Wolfdieter Lang
a(n) = -1 + (A*B^n + C*D^n)/10, with A, C = 5 +- 3*sqrt(5), B, D = (1 +- sqrt(5))/2. - Ralf Stephan, Mar 02 2003
a(1) = 0, a(2) = 0, a(3) = 1, then a(n) = ceiling(phi*a(n-1)) where phi is the golden ratio (1 + sqrt(5))/2. - Benoit Cloitre, May 06 2003
Conjecture: for all c such that 2*(2 - Phi) <= c < (2 + Phi)*(2 - Phi) we have a(n) = floor(Phi*a(n-1) + c) for n > 4. - Gerald McGarvey, Jul 22 2004. This is true provided n > 3 is changed to n > 4, see proof in Comments section. - Russell Jay Hendel, Mar 15 2015
a(n) = Sum_{k = 0..floor((n-2)/2)} binomial(n-k-2, k+1). - Paul Barry, Sep 23 2004
a(n+3) = Sum_{k = 0..floor(n/3)} binomial(n-2*k, k)*(-1)^k*2^(n-3*k). - Paul Barry, Oct 20 2004
a(n+1) = Sum(binomial(n-r, r)), r = 1, 2, ... which is the case t = 2 and k = 2 in the general case of t-strings and k blocks: a(n+1, k, t) = Sum(binomial(n-r*(t-1), r)*S2(n-r*(t-1)-1, k-1)), r = 1, 2, ... - Augustine O. Munagi, Apr 11 2005
a(n) = Sum_{k = 0..n-2} k*Fibonacci(n - k - 3). - Ross La Haye, May 31 2006
a(n) = term (3, 2) in the 3 X 3 matrix [1, 1, 0; 1, 0, 0; 1, 0, 1]^(n-1). - Alois P. Heinz, Jul 24 2008
For n >= 4, a(n) = ceiling(phi*a(n-1)), where phi is the golden ratio. - Vladimir Shevelev, Jul 04 2010
Closed-form without two leading zeros g.f.: 1/(1 - 2*x - x^3); ((5 + 2*sqrt(5))*((1 + sqrt(5))/2)^n + (5 - 2*sqrt(5))*((1 - sqrt(5))/2)^n - 5)/5; closed-form with two leading 0's g.f.: x^2/(1 - 2*x - x^3); ((5 + sqrt(5))*((1 + sqrt(5))/2)^n + (5 - sqrt(5))*((1 - sqrt(5))/2)^n - 10)/10. - Tim Monahan, Jul 10 2011
A000119(a(n)) = 1. - Reinhard Zumkeller, Dec 28 2012
a(n) = A228074(n - 1, 2) for n > 2. - Reinhard Zumkeller, Aug 15 2013
G.f.: Q(0)*x^2/2, where Q(k) = 1 + 1/(1 - x*(4*k + 2 - x^2)/( x*(4*k + 4 - x^2) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 30 2013
A083368(a(n+3)) = n. - Reinhard Zumkeller, Aug 10 2014
E.g.f.: 1 - exp(x) + 2*exp(x/2)*sinh(sqrt(5)*x/2)/sqrt(5). - Ilya Gutkovskiy, Jun 15 2016
a(n) = A000032(3+n) - 1 mod A000045(3+n). - Mario C. Enriquez, Apr 01 2017
a(n) = Sum_{i=0..n-2} Fibonacci(i). - Giorgi Dalakishvili (mcnamara_gio(AT)yahoo.com), Apr 02 2005 [corrected by Doug Bell, Jun 01 2017]
a(n+2) = Sum_{j = 0..floor(n/2)} Sum_{k = 0..j} binomial(n - 2*j, k+1)*binomial(j, k). - Tony Foster III, Sep 08 2017
From Peter Bala, Nov 12 2021: (Start)
a(4*n) = Fibonacci(2*n+1)*Lucas(2*n-1) = A081006(n);
a(4*n+1) = Fibonacci(2*n)*Lucas(2*n+1) = A081007(n);
a(4*n+2) = Fibonacci(2*n)*Lucas(2*n+2) = A081008(n);
a(4*n+3) = Fibonacci(2*n+2)*Lucas(2*n+1) = A081009(n). (End)
G.f.: x^3/((1 - x - x^2)*(1 - x)) = Sum_{n >= 0} (-1)^n * x^(n+3) *( Product_{k = 1..n} (k - x)/Product_{k = 1..n+2} (1 - k*x) ) (a telescoping series). - Peter Bala, May 08 2024
Product_{n>=4} (1 + (-1)^n/a(n)) = 3*phi/4, where phi is the golden ratio (A001622). - Amiram Eldar, Nov 28 2024

Extensions

Edited by N. J. A. Sloane, Apr 04 2011

A285362 Sum T(n,k) of the entries in the k-th blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 15, 12, 3, 60, 58, 28, 4, 262, 273, 185, 55, 5, 1243, 1329, 1094, 495, 96, 6, 6358, 6839, 6293, 3757, 1148, 154, 7, 34835, 37423, 36619, 26421, 11122, 2380, 232, 8, 203307, 217606, 219931, 180482, 96454, 28975, 4518, 333, 9, 1257913, 1340597, 1376929, 1230737, 787959, 308127, 67898, 7995, 460, 10
Offset: 1

Views

Author

Alois P. Heinz, Apr 17 2017

Keywords

Examples

			T(3,2) = 12 because the sum of the entries in the second blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+2+5+2 = 12.
Triangle T(n,k) begins:
      1;
      4,     2;
     15,    12,     3;
     60,    58,    28,     4;
    262,   273,   185,    55,     5;
   1243,  1329,  1094,   495,    96,    6;
   6358,  6839,  6293,  3757,  1148,  154,   7;
  34835, 37423, 36619, 26421, 11122, 2380, 232, 8;
  ...
		

Crossrefs

Row sums give A000110(n) * A000217(n) = A105488(n+3).
Main diagonal and first lower diagonal give: A000027, A006000 (for n>0).
T(2n+1,n+1) gives A285410.

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, m) option remember; `if`(n=0, [1, 0], add((p-> p
            +[0, (h-n+1)*p[1]*x^j])(b(n-1, max(m, j))), j=1..m+1))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, 0)[2])
        end:
    seq(T(n), n=1..12);
  • Mathematica
    T[h_] := T[h] = Module[{b}, b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[# + {0, (h - n + 1)*#[[1]]*x^j}&[b[n - 1, Max[m, j]]], {j, 1, m + 1}]]; Table[Coefficient[#, x, i], {i, 1, n}]&[b[h, 0][[2]]]];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)

A105489 Number of partitions of {1...n} containing 3 detached pairs of consecutive integers, i.e., partitions in which only 1- or 2-strings of consecutive integers can appear in a block and there are exactly three 2-strings.

Original entry on oeis.org

2, 20, 150, 1040, 7105, 49112, 347760, 2537640, 19135875, 149285400, 1205088742, 10062575068, 86859191510, 774456785200, 7126496659960, 67617733760064, 660932425168071, 6649326113764980, 68793130453044760, 731299516881396540
Offset: 6

Views

Author

Augustine O. Munagi, Apr 10 2005

Keywords

Comments

Number of partitions enumerated by A105480 in which the maximal length of consecutive integers in a block is 2.
With offset 3t, number of partitions of {1...N} containing 3 detached strings of t consecutive integers, where N = n + 3j, t = 2 + j, j = 0, 1, 2, ..., i.e., partitions of {1,..,N} in which only v-strings of consecutive integers can appear in a block, where v=1 or v=t and there are exactly three t-strings.

Examples

			a(6) = 2 because the partitions of {1,2,3,4,5,6} with 3 detached pairs of consecutive integers are 12/34/56, 1256/34.
		

Crossrefs

Programs

  • Maple
    seq(binomial(n-3,3)*combinat[bell](n-4),n=6..25);
    a:=n->sum(numbcomb (n,2)*bell(n)/3, j=0..n): seq(a(n), n=2..21); # Zerinvary Lajos, Apr 25 2007

Formula

a(n) = binomial(n-3, 3)*Bell(n-4), which is the case r=3 in the general case of r pairs, d(n,r) = binomial(n-r, r)*Bell(n-r-1), which is the case t=2 of the general formula d(n,r,t) = binomial(n-r*(t-1), r)*Bell(n-r*(t-1)-1).

A285595 Sum T(n,k) of the k-th entries in all blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 17, 10, 3, 76, 52, 18, 4, 362, 274, 111, 28, 5, 1842, 1500, 675, 200, 40, 6, 9991, 8614, 4185, 1380, 325, 54, 7, 57568, 51992, 26832, 9568, 2510, 492, 70, 8, 351125, 329650, 178755, 67820, 19255, 4206, 707, 88, 9, 2259302, 2192434, 1239351, 494828, 149605, 35382, 6629, 976, 108, 10
Offset: 1

Views

Author

Alois P. Heinz, Apr 22 2017

Keywords

Comments

T(n,k) is also k times the number of blocks of size >k in all set partitions of [n+1]. T(3,2) = 10 = 2 * 5 because there are 5 blocks of size >2 in all set partitions of [4], namely in 1234, 123|4, 124|3, 134|2, 1|234.

Examples

			T(3,2) = 10 because the sum of the second entries in all blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 2+2+3+3+0  = 10.
Triangle T(n,k) begins:
      1;
      4,     2;
     17,    10,     3;
     76,    52,    18,    4;
    362,   274,   111,   28,    5;
   1842,  1500,   675,  200,   40,   6;
   9991,  8614,  4185, 1380,  325,  54,  7;
  57568, 51992, 26832, 9568, 2510, 492, 70, 8;
  ...
		

Crossrefs

Column k=1 gives A124325(n+1).
Row sums give A000110(n) * A000217(n) = A105488(n+3).
Main diagonal and first lower diagonal give: A000027, A028552.

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, l) option remember; `if`(n=0, [1, 0],
            (p-> p+[0, (h-n+1)*p[1]*x^1])(b(n-1, [l[], 1]))+
             add((p-> p+[0, (h-n+1)*p[1]*x^(l[j]+1)])(b(n-1,
             sort(subsop(j=l[j]+1, l), `>`))), j=1..nops(l)))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, [])[2])
        end:
    seq(T(n), n=1..12);
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, [1, 0],
          add((p-> p+[0, p[1]*add(x^k, k=1..j-1)])(
             b(n-j)*binomial(n-1, j-1)), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i)*i, i=1..n))(b(n+1)[2]):
    seq(T(n), n=1..12);
  • Mathematica
    b[n_] := b[n] = If[n == 0, {1, 0}, Sum[# + {0, #[[1]]*Sum[x^k, {k, 1, j-1} ]}&[b[n - j]*Binomial[n - 1, j - 1]], {j, 1, n}]];
    T[n_] := Table[Coefficient[#, x, i]*i, {i, 1, n}] &[b[n + 1][[2]]];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, May 23 2018, translated from 2nd Maple program *)

Formula

T(n,k) = k * Sum_{j=k+1..n+1} binomial(n+1,j)*A000110(n+1-j).
T(n,k) = k * Sum_{j=k+1..n+1} A175757(n+1,j).
Sum_{k=1..n} T(n,k)/k = A278677(n-1).

A105484 Number of partitions of {1...n} containing 2 strings of 3 consecutive integers, where each string is counted within a block and a string of more than 3 consecutive integers are counted three at a time.

Original entry on oeis.org

1, 2, 9, 38, 177, 882, 4711, 26795, 161583, 1028992, 6896067, 48487476, 356703531, 2738868784, 21901044795, 182022288438, 1569519971934, 14017732109520, 129480496353104, 1235228480628932, 12154988981496309, 123229919746398894, 1285758785855488107
Offset: 4

Views

Author

Augustine O. Munagi, Apr 10 2005

Keywords

Examples

			a(6)=9 because the partitions of {1,...,6} with 2 strings of 3 consecutive integers are 12346/5, 13456/2, 16/2345, 1234/56, 123/456, 12/3456, 1234/5/6, 1/2345/6, 1/2/3456.
		

Crossrefs

Programs

  • Maple
    c := proc(n,k,r) option remember ; local j ; if r =0 then add(binomial(n-j,j)*combinat[stirling2](n-j-1,k-1),j=0..floor(n/2)) ; else if r <0 or r > n-k-1 then RETURN(0) fi ; if n <1 then RETURN(0) fi ; if k <1 then RETURN(0) fi ; RETURN( c(n-1,k-1,r)+(k-1)*c(n-1,k,r)+c(n-2,k-1,r)+(k-1)*c(n-2,k,r) +c(n-1,k,r-1)-c(n-2,k-1,r-1)-(k-1)*c(n-2,k,r-1) ) ; fi ; end: A105484 := proc(n) local k ; add(c(n,k,2),k=1..n) ; end: for n from 4 to 27 do printf("%d, ",A105484(n)) ; od ; # R. J. Mathar, Feb 20 2007
  • Mathematica
    S2[_, -1] = 0;
    S2[n_, k_] = StirlingS2[n, k];
    c[n_, k_, r_] := c[n, k, r] = Which[r == 0, Sum[Binomial[n - j, j]*S2[n - j - 1, k - 1], {j, 0, Floor[n/2]}], r < 0 || r > n - k - 1, 0, n < 1, 0, k < 1, 0, True, c[n - 1, k - 1, r] + (k - 1)*c[n - 1, k, r] + c[n - 2, k - 1, r] + (k - 1)*c[n - 2, k, r] + c[n - 1, k, r - 1] - c[n - 2, k - 1, r - 1] - (k - 1)*c[n - 2, k, r - 1]];
    A105484[n_] := Sum[c[n, k, 2], {k, 1, n}];
    Table[A105484[n], {n, 4, 27}] (* Jean-François Alcover, May 10 2023, after R. J. Mathar *)

Formula

a(n) = Sum_{k=1..n} c(n, k, 2), where c(n, k, 2) is the case r =2 of c(n, k, r) given by c(n, k, r)=c(n-1, k-1, r)+(k-1)c(n-1, k, r)+c(n-2, k-1, r)+(k-1)c(n-2, k, r)+c(n-1, k, r-1)-c(n-2, k-1, r-1)-(k-1)c(n-2, k, r-1), r=0, 1, .., n-k-1, k=1, 2, .., n-2r, c(n, k, 0) = Sum_{j= 0..floor(n/2)} binomial(n-j, j)*S2(n-j-1, k-1).

Extensions

More terms from R. J. Mathar, Feb 20 2007

A286232 Sum T(n,k) of the entries in the k-th last blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 5, 1, 19, 10, 1, 75, 57, 17, 1, 323, 285, 145, 26, 1, 1512, 1421, 975, 317, 37, 1, 7630, 7395, 5999, 2865, 616, 50, 1, 41245, 40726, 36183, 22411, 7315, 1094, 65, 1, 237573, 237759, 221689, 163488, 72581, 16630, 1812, 82, 1, 1451359, 1468162, 1405001, 1160764, 649723, 206249, 34425, 2840, 101, 1
Offset: 1

Views

Author

Alois P. Heinz, May 04 2017

Keywords

Examples

			T(3,2) = 10 because the sum of the entries in the second last blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+4+1+2 = 10.
Triangle T(n,k) begins:
      1;
      5,     1;
     19,    10,     1;
     75,    57,    17,     1;
    323,   285,   145,    26,    1;
   1512,  1421,   975,   317,   37,    1;
   7630,  7395,  5999,  2865,  616,   50,  1;
  41245, 40726, 36183, 22411, 7315, 1094, 65, 1;
  ...
		

Crossrefs

Column k=1 gives A285424.
Main diagonal and first lower diagonal give: A000012, A002522.
Row sums give A000110(n) * A000217(n) = A105488(n+3).

Programs

  • Mathematica
    app[P_, n_] := Module[{P0}, Table[P0 = Append[P, {}]; AppendTo[P0[[i]], n]; If[Last[P0] == {}, Most[P0], P0], {i, 1, Length[P]+1}]];
    setPartitions[n_] := setPartitions[n] = If[n == 1, {{{1}}}, Flatten[app[#, n]& /@ setPartitions[n-1], 1]];
    T[n_, k_] := Select[setPartitions[n], Length[#] >= k&][[All, -k]] // Flatten // Total;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 21 2021 *)

A346772 Total sum of block indices of the elements over all partitions of [n].

Original entry on oeis.org

0, 1, 5, 22, 100, 482, 2475, 13527, 78476, 481687, 3117962, 21218851, 151387882, 1129430737, 8790433999, 71222812912, 599577147056, 5235054113412, 47331036294905, 442462325254995, 4270909302907430, 42514043248222709, 435920900603529954, 4599155199953703373
Offset: 0

Views

Author

Alois P. Heinz, Aug 02 2021

Keywords

Examples

			a(3) = 22 = 3 + 4 + 4 + 5 + 6, summing block indices 111, 112, 121, 122, 123 of the 5 partitions of [3]: 123, 12|3, 13|2, 1|23, 1|2|3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, [1, 0], add(
         (p-> p+[0, p[1]*j])(b(n-1, max(m, j))), j=1..m+1))
        end:
    a:= n-> b(n, 0)[2]:
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[
         Function[p, p+{0, p[[1]]*j}][b[n-1, Max[m, j]]], {j, 1, m+1}]];
    a[n_] := b[n, 0][[2]];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 27 2022, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=1..n} A120057(n,k).
a(n) = Sum_{k=0..n*(n-1)/2} (n+k) * A126347(n,k).
a(n) = Sum_{k=1..n} k * A270236(n,k).

A271023 Number T(n,k) of set partitions of [n] having exactly k pairs (i,j) with i=0, 0<=k<=n*(n-1)/2 read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 0, 1, 1, 6, 3, 4, 0, 0, 1, 1, 10, 15, 10, 10, 0, 5, 0, 0, 0, 1, 1, 15, 45, 35, 60, 0, 25, 15, 0, 0, 6, 0, 0, 0, 0, 1, 1, 21, 105, 140, 210, 105, 105, 105, 0, 35, 21, 21, 0, 0, 0, 7, 0, 0, 0, 0, 0, 1, 1, 28, 210, 476, 665, 840, 350, 700, 210
Offset: 0

Views

Author

Alois P. Heinz, Mar 28 2016

Keywords

Examples

			T(3,0) = 1: 1|2|3.
T(3,1) = 3: 12|3, 13|2, 1|23.
T(3,3) = 1: 123.
Triangle T(n,k) begins:
  1;
  1;
  1,  1;
  1,  3,  0,  1;
  1,  6,  3,  4,  0, 0,  1;
  1, 10, 15, 10, 10, 0,  5,  0, 0, 0, 1;
  1, 15, 45, 35, 60, 0, 25, 15, 0, 0, 6, 0, 0, 0, 0, 1;
		

Crossrefs

Columns k=0-2 give: A000012, A161680, A050534(n-1) for n>0.
Row sums give A000110.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, x^
          add(j*(j-1)/2, j=l), b(n-1, [l[], 1])+
          add(b(n-1, subsop(j=l[j]+1, l)), j=1..nops(l)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [])):
    seq(T(n), n=0..10);
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, x^Sum[j*(j-1)/2, {j, l}], b[n-1, Append[l, 1]] + Sum[b[n-1, ReplacePart[l, j -> l[[j]]+1]], {j, 1, Length[l]}]];
    T[n_] := CoefficientList[b[n, {}], x];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 29 2022, after Alois P. Heinz *)

Formula

T(n,k) = A271024(n,n*(n-1)/2-k).
Sum_{k=0..n*(n-1)/2} k * T(n,k) = A105488(n+2) for n > 1.

A286897 Sum T(n,k) of the k-th last entries in all blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 5, 1, 23, 6, 1, 109, 33, 7, 1, 544, 182, 45, 8, 1, 2876, 1034, 284, 59, 9, 1, 16113, 6122, 1815, 420, 75, 10, 1, 95495, 37927, 11931, 2987, 595, 93, 11, 1, 597155, 246030, 81205, 21620, 4665, 814, 113, 12, 1, 3929243, 1669941, 573724, 160607, 36900, 6979, 1082, 135, 13, 1
Offset: 1

Views

Author

Alois P. Heinz, May 15 2017

Keywords

Examples

			T(3,2) = 6 because the sum of the second last entries in all blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 2+1+1+2 = 6.
Triangle T(n,k) begins:
      1;
      5,     1;
     23,     6,     1;
    109,    33,     7,    1;
    544,   182,    45,    8,   1;
   2876,  1034,   284,   59,   9,  1;
  16113,  6122,  1815,  420,  75, 10,  1;
  95495, 37927, 11931, 2987, 595, 93, 11, 1;
  ...
		

Crossrefs

Column k=1 gives A278677(n-1).
Row sums give A000110(n) * A000217(n) = A105488(n+3).
Cf. A285595.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, [1, 0],
          (p-> p+[0, n*p[1]*x^1])(b(n-1, [l[], 1]))+
           add((p-> p+[0, n*p[1]*x^(l[j]+1)])(b(n-1,
           sort(subsop(j=l[j]+1, l), `>`))), j=1..nops(l)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, [])[2]):
    seq(T(n), n=1..14);
  • Mathematica
    b[0, ] = {1, 0}; b[n, l_] := b[n, l] = Function[p, p + {0, n*p[[1]]*x^1} ][b[n - 1, Append[l, 1]]] + Sum[Function[p, p + {0, n*p[[1]]*x^(l[[j]] + 1)}][b[n - 1, Reverse @ Sort[ReplacePart[l, j -> l[[j]] + 1]]]], {j, 1, Length[l]}];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, n}]][b[n, {}][[2]]];
    Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, May 26 2018, from Maple *)

A105492 Number of partitions of {1,...,n} containing 2 strings of 3 consecutive integers such that only v-strings of consecutive integers can appear in a block, where v = 1,2,3.

Original entry on oeis.org

1, 6, 36, 210, 1260, 7833, 50701, 342126, 2406645, 17633820, 134427468, 1064801442, 8751834839, 74540800014
Offset: 6

Views

Author

Augustine O. Munagi, Apr 11 2005

Keywords

Comments

Partitions enumerated by A105484 in which the maximal length of consecutive integers in a block is 3.

Examples

			a(7)=6; the enumerated partitions are 123567/4, 1237/456, 1567/234, 123/456/7, 123/4/567, 1/234/567.
		

References

  • A. O. Munagi, Set Partitions with Successions and Separations, Int. J. Math and Math. Sc. 2005, no. 3 (2005), 451-463

Crossrefs

Formula

a(n)=Sum(w(n, k, 2), k=1...n), where w(n, k, 2) is the case r=2 of w(n, k, r) given by w(m, k, r)=w(m-1, k-1, r)+(k-1)w(m-1, k, r)+w(m-2, k-1, r)+(k-1)w(m-2, k, r) +w(m-3, k-1, r-1)+(k-1)w(m-3, k, r-1) r=0, 1, ..., floor(n/3), k=1, 2, ..., n-2r, w(n, k, 0)=sum(binomial(n-j, j)*S2(n-j-1, k-1), j=0..floor(n/2)).
Showing 1-10 of 10 results.