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

A011782 Coefficients of expansion of (1-x)/(1-2*x) in powers of x.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592
Offset: 0

Views

Author

Lee D. Killough (killough(AT)wagner.convex.com)

Keywords

Comments

Apart from initial term, same as A000079 (powers of 2).
Number of compositions (ordered partitions) of n. - Toby Bartels, Aug 27 2003
Number of ways of putting n unlabeled items into (any number of) labeled boxes where every box contains at least one item. Also "unimodal permutations of n items", i.e., those which rise then fall. (E.g., for three items: ABC, ACB, BCA and CBA are unimodal.) - Henry Bottomley, Jan 17 2001
Number of permutations in S_n avoiding the patterns 213 and 312. - Tuwani Albert Tshifhumulo, Apr 20 2001. More generally (see Simion and Schmidt), the number of permutations in S_n avoiding (i) the 123 and 132 patterns; (ii) the 123 and 213 patterns; (iii) the 132 and 213 patterns; (iv) the 132 and 231 patterns; (v) the 132 and 312 patterns; (vi) the 213 and 231 patterns; (vii) the 213 and 312 patterns; (viii) the 231 and 312 patterns; (ix) the 231 and 321 patterns; (x) the 312 and 321 patterns.
a(n+2) is the number of distinct Boolean functions of n variables under action of symmetric group.
Number of unlabeled (1+2)-free posets. - Detlef Pauly, May 25 2003
Image of the central binomial coefficients A000984 under the Riordan array ((1-x), x*(1-x)). - Paul Barry, Mar 18 2005
Binomial transform of (1, 0, 1, 0, 1, 0, 1, 0, 1, 0, ...); inverse binomial transform of A007051. - Philippe Deléham, Jul 04 2005
Also, number of rationals in [0, 1) whose binary expansions terminate after n bits. - Brad Chalfan, May 29 2006
Equals row sums of triangle A144157. - Gary W. Adamson, Sep 12 2008
Prepend A089067 with a 1, getting (1, 1, 3, 5, 13, 23, 51, ...) as polcoeff A(x); then (1, 1, 2, 4, 8, 16, ...) = A(x)/A(x^2). - Gary W. Adamson, Feb 18 2010
An elephant sequence, see A175655. For the central square four A[5] vectors, with decimal values 2, 8, 32 and 128, lead to this sequence. For the corner squares these vectors lead to the companion sequence A094373. - Johannes W. Meijer, Aug 15 2010
From Paul Curtz, Jul 20 2011: (Start)
Array T(m,n) = 2*T(m,n-1) + T(m-1,n):
1, 1, 2, 4, 8, 16, ... = a(n)
1, 3, 8, 20, 48, 112, ... = A001792,
1, 5, 18, 56, 160, 432, ... = A001793,
1, 7, 32, 120, 400, 1232, ... = A001794,
1, 9, 50, 220, 840, 2912, ... = A006974, followed with A006975, A006976, gives nonzero coefficients of Chebyshev polynomials of first kind A039991 =
1,
1, 0,
2, 0, -1,
4, 0, -3, 0,
8, 0, -8, 0, 1.
T(m,n) third vertical: 2*n^2, n positive (A001105).
Fourth vertical appears in Janet table even rows, last vertical (A168342 array, A138509, rank 3, 13, = A166911)). (End)
A131577(n) and differences are:
0, 1, 2, 4, 8, 16,
1, 1, 2, 4, 8, 16, = a(n),
0, 1, 2, 4, 8, 16,
1, 1, 2, 4, 8, 16.
Number of 2-color necklaces of length 2n equal to their complemented reversal. For length 2n+1, the number is 0. - David W. Wilson, Jan 01 2012
Edges and also central terms of triangle A198069: a(0) = A198069(0,0) and for n > 0: a(n) = A198069(n,0) = A198069(n,2^n) = A198069(n,2^(n-1)). - Reinhard Zumkeller, May 26 2013
These could be called the composition numbers (see the second comment) since the equivalent sequence for partitions is A000041, the partition numbers. - Omar E. Pol, Aug 28 2013
Number of self conjugate integer partitions with exactly n parts for n>=1. - David Christopher, Aug 18 2014
The sequence is the INVERT transform of (1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...). - Gary W. Adamson, Jul 16 2015
Number of threshold graphs on n nodes [Hougardy]. - Falk Hüffner, Dec 03 2015
Number of ternary words of length n in which binary subwords appear in the form 10...0. - Milan Janjic, Jan 25 2017
a(n) is the number of words of length n over an alphabet of two letters, of which one letter appears an even number of times (the empty word of length 0 is included). See the analogous odd number case in A131577, and the Balakrishnan reference in A006516 (the 4-letter odd case), pp. 68-69, problems 2.66, 2.67 and 2.68. - Wolfdieter Lang, Jul 17 2017
Number of D-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are D-equivalent iff the positions of pattern D are identical in these paths. - Sergey Kirgizov, Apr 08 2018
Number of color patterns (set partitions) for an oriented row of length n using two or fewer colors (subsets). Two color patterns are equivalent if we permute the colors. For a(4)=8, the 4 achiral patterns are AAAA, AABB, ABAB, and ABBA; the 4 chiral patterns are the 2 pairs AAAB-ABBB and AABA-ABAA. - Robert A. Russell, Oct 30 2018
The determinant of the symmetric n X n matrix M defined by M(i,j) = (-1)^max(i,j) for 1 <= i,j <= n is equal to a(n) * (-1)^(n*(n+1)/2). - Bernard Schott, Dec 29 2018
For n>=1, a(n) is the number of permutations of length n whose cyclic representations can be written in such a way that when the cycle parentheses are removed what remains is 1 through n in natural order. For example, a(4)=8 since there are exactly 8 permutations of this form, namely, (1 2 3 4), (1)(2 3 4), (1 2)(3 4), (1 2 3)(4), (1)(2)(3 4), (1)(2 3)(4), (1 2)(3)(4), and (1)(2)(3)(4). Our result follows readily by conditioning on k, the number of parentheses pairs of the form ")(" in the cyclic representation. Since there are C(n-1,k) ways to insert these in the cyclic representation and since k runs from 0 to n-1, we obtain a(n) = Sum_{k=0..n-1} C(n-1,k) = 2^(n-1). - Dennis P. Walsh, May 23 2020
Maximum number of preimages that a permutation of length n + 1 can have under the consecutive-231-avoiding stack-sorting map. - Colin Defant, Aug 28 2020
a(n) is the number of occurrences of the empty set {} in the von Neumann ordinals from 0 up to n. Each ordinal k is defined as the set of all smaller ordinals: 0 = {}, 1 = {0}, 2 = {0,1}, etc. Since {} is the foundational element of all ordinals, the total number of times it appears grows as powers of 2. - Kyle Wyonch, Mar 30 2025

Examples

			G.f. = 1 + x + 2*x^2 + 4*x^3 + 8*x^4 + 16*x^5 + 32*x^6 + 64*x^7 + 128*x^8 + ...
    ( -1   1  -1)
det (  1   1   1)  = 4
    ( -1  -1  -1)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education Journal, Vol. 31, No. 1, pp. 24-28, Winter 1997.
  • S. Kitaev, Patterns in Permutations and Words, Springer-Verlag, 2011. see p. 399 Table A.7
  • Xavier Merlin, Methodix Algèbre, Ellipses, 1995, p. 153.

Crossrefs

Sequences with g.f.'s of the form ((1-x)/(1-2*x))^k: this sequence (k=1), A045623 (k=2), A058396 (k=3), A062109 (k=4), A169792 (k=5), A169793 (k=6), A169794 (k=7), A169795 (k=8), A169796 (k=9), A169797 (k=10).
Cf. A005418 (unoriented), A122746(n-3) (chiral), A016116 (achiral).
Row sums of triangle A100257.
A row of A160232.
Row 2 of A278984.

Programs

  • Haskell
    a011782 n = a011782_list !! n
    a011782_list = 1 : scanl1 (+) a011782_list
    -- Reinhard Zumkeller, Jul 21 2013
    
  • Magma
    [Floor((1+2^n)/2): n in [0..35]]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    A011782:= n-> ceil(2^(n-1)): seq(A011782(n), n=0..50); # Wesley Ivan Hurt, Feb 21 2015
    with(PolynomialTools):  A011782:=seq(coeftayl((1-x)/(1-2*x), x = 0, k),k=0..10^2); # Muniru A Asiru, Sep 26 2017
  • Mathematica
    f[s_] := Append[s, Ceiling[Plus @@ s]]; Nest[f, {1}, 32] (* Robert G. Wilson v, Jul 07 2006 *)
    CoefficientList[ Series[(1-x)/(1-2x), {x, 0, 32}], x] (* Robert G. Wilson v, Jul 07 2006 *)
    Table[Sum[StirlingS2[n, k], {k,0,2}], {n, 0, 30}] (* Robert A. Russell, Apr 25 2018 *)
    Join[{1},NestList[2#&,1,40]] (* Harvey P. Dale, Dec 06 2018 *)
  • PARI
    {a(n) = if( n<1, n==0, 2^(n-1))};
    
  • PARI
    Vec((1-x)/(1-2*x) + O(x^30)) \\ Altug Alkan, Oct 31 2015
    
  • Python
    def A011782(n): return 1 if n == 0 else 2**(n-1) # Chai Wah Wu, May 11 2022
  • Sage
    [sum(stirling_number2(n,j) for j in (0..2)) for n in (0..35)] # G. C. Greubel, Jun 02 2020
    

Formula

a(0) = 1, a(n) = 2^(n-1).
G.f.: (1 - x) / (1 - 2*x) = 1 / (1 - x / (1 - x)). - Michael Somos, Apr 18 2012
E.g.f.: cosh(z)*exp(z) = (exp(2*z) + 1)/2.
a(0) = 1 and for n>0, a(n) = sum of all previous terms.
a(n) = Sum_{k=0..n} binomial(n, 2*k). - Paul Barry, Feb 25 2003
a(n) = Sum_{k=0..n} binomial(n,k)*(1+(-1)^k)/2. - Paul Barry, May 27 2003
a(n) = floor((1+2^n)/2). - Toby Bartels (toby+sloane(AT)math.ucr.edu), Aug 27 2003
G.f.: Sum_{i>=0} x^i/(1-x)^i. - Jon Perry, Jul 10 2004
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(k+1, n-k)*binomial(2*k, k). - Paul Barry, Mar 18 2005
a(n) = Sum_{k=0..floor(n/2)} A055830(n-k, k). - Philippe Deléham, Oct 22 2006
a(n) = Sum_{k=0..n} A098158(n,k). - Philippe Deléham, Dec 04 2006
G.f.: 1/(1 - (x + x^2 + x^3 + ...)). - Geoffrey Critzer, Aug 30 2008
a(n) = A000079(n) - A131577(n).
a(n) = A173921(A000079(n)). - Reinhard Zumkeller, Mar 04 2010
a(n) = Sum_{k=2^n..2^(n+1)-1} A093873(k)/A093875(k), sums of rows of the full tree of Kepler's harmonic fractions. - Reinhard Zumkeller, Oct 17 2010
E.g.f.: (exp(2*x)+1)/2 = (G(0) + 1)/2; G(k) = 1 + 2*x/(2*k+1 - x*(2*k+1)/(x + (k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Dec 03 2011
A051049(n) = p(n+1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 18 2012
A008619(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 18 2012
INVERT transform is A122367. MOBIUS transform is A123707. EULER transform of A059966. PSUM transform is A000079. PSUMSIGN transform is A078008. BINOMIAL transform is A007051. REVERT transform is A105523. A002866(n) = a(n)*n!. - Michael Somos, Apr 18 2012
G.f.: U(0), where U(k) = 1 + x*(k+3) - x*(k+2)/U(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Oct 10 2012
a(n) = A000041(n) + A056823(n). - Omar E. Pol, Aug 31 2013
E.g.f.: E(0), where E(k) = 1 + x/( 2*k+1 - x/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Dec 25 2013
G.f.: 1 + x/(1 + x)*( 1 + 3*x/(1 + 3*x)*( 1 + 5*x/(1 + 5*x)*( 1 + 7*x/(1 + 7*x)*( 1 + ... )))). - Peter Bala, May 27 2017
a(n) = Sum_{k=0..2} stirling2(n, k).
G.f.: Sum_{j=0..k} A248925(k,j)*x^j / Product_{j=1..k} 1-j*x with k=2. - Robert A. Russell, Apr 25 2018
a(n) = A053120(n, n), n >= 0, (main diagonal of triangle of Chebyshev's T polynomials). - Wolfdieter Lang, Nov 26 2019

Extensions

Additional comments from Emeric Deutsch, May 14 2001
Typo corrected by Philippe Deléham, Oct 25 2008

A189076 Number of compositions of n that avoid the pattern 23-1.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 31, 61, 118, 228, 440, 846, 1623, 3111, 5955, 11385, 21752, 41530, 79250, 151161, 288224, 549408, 1047034, 1995000, 3800662, 7239710, 13789219, 26261678, 50012275, 95237360, 181350695, 345315255, 657506300, 1251912618, 2383636280, 4538364446
Offset: 0

Views

Author

N. J. A. Sloane, Apr 16 2011

Keywords

Comments

Note that an exponentiation ^(-1) is missing in Example 4.4. The notation in Theorem 4.3 is complete.
Theorem: The reverse of a composition avoids 23-1 iff its leaders of maximal weakly increasing runs are weakly decreasing. For example, the composition y = (3,2,1,2,2,1,2,5,1,1,1) has maximal weakly increasing runs ((3),(2),(1,2,2),(1,2,5),(1,1,1)), with leaders (3,2,1,1,1), which are weakly decreasing, so the reverse of y is counted under a(21). - Gus Wiseman, Aug 19 2024

Examples

			From _Gus Wiseman_, Aug 19 2024: (Start)
The a(6) = 31 compositions:
  .  (6)  (5,1)  (4,1,1)  (3,1,1,1)  (2,1,1,1,1)  (1,1,1,1,1,1)
          (1,5)  (1,4,1)  (1,3,1,1)  (1,2,1,1,1)
          (4,2)  (1,1,4)  (1,1,3,1)  (1,1,2,1,1)
          (2,4)  (3,2,1)  (1,1,1,3)  (1,1,1,2,1)
          (3,3)  (3,1,2)  (2,2,1,1)  (1,1,1,1,2)
                 (2,3,1)  (2,1,2,1)
                 (2,1,3)  (2,1,1,2)
                 (1,2,3)  (1,2,2,1)
                 (2,2,2)  (1,2,1,2)
                          (1,1,2,2)
Missing is (1,3,2), reverse of (2,3,1).
(End)
		

Crossrefs

The non-dashed version is A102726.
The version for 3-12 is A188900, complement A375406.
Avoiding 12-1 also gives A188920 in reverse.
The version for 13-2 is A189077.
For identical leaders we have A374631, ranks A374633.
For distinct leaders we have A374632, ranks A374768.
The complement is counted by A374636, ranks A375137.
A011782 counts compositions.
A238130, A238279, A333755 count compositions by number of runs.

Programs

  • Maple
    A189075 := proc(n) local g,i; g := 1; for i from 1 to n do 1-x^i/mul ( 1-x^j,j=i+1..n-i) ; g := g*% ; end do: g := expand(1/g) ; g := taylor(g,x=0,n+1) ; coeftayl(g,x=0,n) ; end proc: # R. J. Mathar, Apr 16 2011
  • Mathematica
    a[n_] := Module[{g = 1, xi}, Do[xi = 1 - x^i/Product[1 - x^j, {j, i+1, n-i}]; g = g xi, {i, n}]; SeriesCoefficient[1/g, {x, 0, n}]];
    a /@ Range[0, 32] (* Jean-François Alcover, Apr 02 2020, after R. J. Mathar *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,y_,z_,_,x_,_}/;xGus Wiseman, Aug 19 2024 *)

A188920 a(n) is the limiting term of the n-th column of the triangle in A188919.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 22, 38, 63, 105, 169, 274, 434, 686, 1069, 1660, 2548, 3897, 5906, 8911, 13352, 19917, 29532, 43605, 64056, 93715, 136499, 198059, 286233, 412199, 591455, 845851, 1205687, 1713286, 2427177, 3428611, 4829563, 6784550, 9505840, 13284849
Offset: 0

Views

Author

N. J. A. Sloane, Apr 13 2011

Keywords

Comments

Also the number of integer compositions of n whose reverse avoids 12-1 and 23-1.
Theorem: The reverse of a composition avoids 12-1 and 23-1 iff its leaders of maximal weakly increasing runs, obtained by splitting it into maximal weakly increasing subsequences and taking the first term of each, are strictly decreasing. For example, the composition y = (4,5,3,2,2,3,1,3,5) has reverse (5,3,1,3,2,2,3,5,4), which avoids 12-1 and 23-1, while the maximal weakly increasing runs of y are ((4,5),(3),(2,2,3),(1,3,5)), with leaders (4,3,2,1), which are strictly decreasing, as required. - Gus Wiseman, Aug 20 2024

Examples

			From _Gus Wiseman_, Aug 20 2024: (Start)
The a(0) = 1 through a(6) = 22 compositions:
  ()  (1)  (2)   (3)    (4)     (5)      (6)
           (11)  (12)   (13)    (14)     (15)
                 (21)   (22)    (23)     (24)
                 (111)  (31)    (32)     (33)
                        (112)   (41)     (42)
                        (211)   (113)    (51)
                        (1111)  (122)    (114)
                                (212)    (123)
                                (221)    (132)
                                (311)    (213)
                                (1112)   (222)
                                (2111)   (312)
                                (11111)  (321)
                                         (411)
                                         (1113)
                                         (1122)
                                         (2112)
                                         (2211)
                                         (3111)
                                         (11112)
                                         (21111)
                                         (111111)
(End)
		

Crossrefs

For leaders of identical runs we have A000041.
Matching 23-1 only gives A189076.
An opposite version is A358836.
For identical leaders we have A374631, ranks A374633.
For distinct leaders we have A374632, ranks A374768.
For weakly increasing leaders we have A374635.
For non-weakly decreasing leaders we have A374636, ranks A375137.
For leaders of anti-runs we have A374680.
For leaders of strictly increasing runs we have A374689.
The complement is counted by A375140, ranks A375295, reverse A375296.
A011782 counts compositions.
A238130, A238279, A333755 count compositions by number of runs.

Programs

  • Mathematica
    b[u_, o_] := b[u, o] = Expand[If[u + o == 0, 1, Sum[b[u - j, o + j - 1]*x^(o + j - 1), {j, 1, u}] + Sum[If[u == 0, b[u + j - 1, o - j]*x^(o - j), 0], {j, 1, o}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[0, n]];
    Take[T[40], 40] (* Jean-François Alcover, Sep 15 2018, after Alois P. Heinz in A188919 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Greater@@First/@Split[Reverse[#],LessEqual]&]],{n,0,15}] (* Gus Wiseman, Aug 20 2024 *)
    - or -
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !MatchQ[#,{_,y_,z_,_,x_,_}/;x<=yGus Wiseman, Aug 20 2024 *)
  • PARI
    B_x(i,N) = {my(x='x+O('x^N), f=(x^i)/(1-x^i)*prod(j=i+1,N-i,1/(1-x^j))); f}
    A_x(N) = {my(x='x+O('x^N), f=1+sum(i=1,N, B_x(i,N)*prod(j=1,i-1,1+B_x(j,N)))); Vec(f)}
    A_x(60) \\ John Tyler Rascoe, Aug 23 2024

Formula

a(n) = 2^(n-1) - A375140(n).
G.f.: 1 + Sum_{i>0} (B(i,x) * Product_{j=1..i-1} (1 + B(j,x))) where B(i,x) = (x^i)/(1-x^i) * Product_{j>i} (1/(1-x^j)). - John Tyler Rascoe, Aug 23 2024

Extensions

More terms from Andrew Baxter, May 17 2011
a(30)-a(39) from Alois P. Heinz, Nov 14 2015

A117989 Number of partitions of n such that the least part occurs at least twice.

Original entry on oeis.org

0, 1, 1, 3, 3, 7, 8, 14, 18, 28, 35, 53, 67, 94, 121, 165, 209, 280, 353, 462, 582, 749, 935, 1192, 1480, 1862, 2302, 2871, 3526, 4366, 5335, 6555, 7976, 9737, 11789, 14317, 17259, 20845, 25032, 30093, 35992, 43087, 51347, 61216, 72710, 86362, 102235
Offset: 1

Views

Author

Emeric Deutsch, Apr 08 2006

Keywords

Comments

More generally, the g.f. for the number of partitions of n such that the least part occurs at least m times is sum(x^(mk)/product(1-x^j, j=k..infinity), k=1..infinity). Also, the number of partitions of n such that if k is the largest part, then k>=2 and k-1 does not occur. Example: a(5)=3 because we have [5],[4,1] and [3,1,1].
Also, the number of partitions of 2n such that the difference between greatest part and smallest part is n. - Vladeta Jovovic, May 09 2008

Examples

			a(5) = 3 because we have [3,1,1], [2,1,1,1] and [1,1,1,1,1].
		

Crossrefs

Programs

  • Haskell
    a117989 n = a117989_list !! (n-1)
    a117989_list = tail $ zipWith (-)
                          (map (* 2) a000041_list) $ tail a000041_list
    -- Reinhard Zumkeller, Nov 12 2015
  • Maple
    g:=sum(x^k*(1-x^(k-1))/product(1-x^j,j=1..k),k=2..70): gser:=series(g,x=0,55): seq(coeff(gser,x,n),n=1..50);
    A117989 := proc(n)
        2*combinat[numbpart](n)-combinat[numbpart](n+1) ;
    end proc: # R. J. Mathar, May 19 2016
  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Count[#,Min[#]]>1&]], {n,50}]  (* Harvey P. Dale, Apr 23 2011 *)
    max = 48; Sum[x^(2*k)/Product[1 - x^j, {j, k, Infinity}], {k, 1, Ceiling[ max/2]}] + O[x]^max // CoefficientList[#, x]& // Rest (* Jean-François Alcover, Sep 11 2017 *)

Formula

G.f.: sum(k>=1, x^(2*k)/prod(j>=k, 1-x^j ) ).
G.f.: sum(k>=1, x^k*(1-x^(k-1))/prod(j=1..k, 1-x^j ) ).
a(n) = 2*A000041(n) - A000041(n+1). - Vladeta Jovovic, Jul 21 2006
a(n) = A056823(n+1) - 2*A056823(n). - Bob Selcoe, Apr 11 2014
a(n) ~ exp(Pi*sqrt(2*n/3)) / (4*sqrt(3)*n) * (1 - (sqrt(3/2)/Pi + 25*Pi/(24*sqrt(6))) / sqrt(n)). - Vaclav Kotesovec, Nov 03 2020

A019472 Weak preference orderings of n alternatives, i.e., orderings that have indifference between at least two alternatives.

Original entry on oeis.org

0, 0, 1, 7, 51, 421, 3963, 42253, 505515, 6724381, 98618763, 1582715773, 27612565995, 520631327581, 10554164679243, 228975516609853, 5294731892093355, 130015079601039901, 3379132289551117323, 92679942218919579133, 2675254894236207563115, 81073734056332364441821
Offset: 0

Views

Author

Robert Ware (bware(AT)wam.umd.edu)

Keywords

Comments

From Gus Wiseman, Jun 24 2020: (Start)
Equivalently, a(n) is number of (1,1)-matching sequences of length n that cover an initial interval of positive integers. For example, the a(2) = 1 and a(3) = 7 sequences are:
(1,1) (1,1,1)
(1,1,2)
(1,2,1)
(1,2,2)
(2,1,1)
(2,1,2)
(2,2,1)
Missing from this list are:
(1,2) (1,2,3)
(2,1) (1,3,2)
(2,1,3)
(2,3,1)
(3,1,2)
(3,2,1)
(End)

Crossrefs

(1,1)-avoiding patterns are counted by A000142.
(1,2)-matching patterns are counted by A056823.
(1,1)-matching compositions are counted by A261982.
(1,1)-matching compositions are ranked by A335488.
Patterns matched by patterns are counted by A335517.

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(j-i)*Binomial[j, i]*i^n, {i, 0, n-1}, {j, 0, n-1}]; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Feb 26 2016, after Peter Luschny *)
  • Sage
    def A019472(n):
        return add(add((-1)^(j-i)*binomial(j, i)*i^n for i in range(n)) for j in range(n))
    [A019472(n) for n in range(21)] # Peter Luschny, Jul 22 2014

Formula

a(n) = A000670(n) - n!. - corrected by Eugene McDonnell, May 12 2000
a(n) = Sum_{j=0..n-1} Sum_{i=0..n-1} (-1)^(j-i)*C(j, i)*i^n. - Peter Luschny, Jul 22 2014

A374636 Number of integer compositions of n whose leaders of maximal weakly increasing runs are not weakly decreasing.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 3, 10, 28, 72, 178, 425, 985, 2237, 4999, 11016, 24006, 51822, 110983, 236064, 499168, 1050118, 2199304, 4587946, 9537506, 19765213, 40847186, 84205453, 173198096, 355520217, 728426569, 1489977348, 3043054678, 6206298312, 12641504738
Offset: 0

Views

Author

Gus Wiseman, Aug 09 2024

Keywords

Comments

The leaders of maximal weakly increasing runs in a sequence are obtained by splitting it into maximal weakly increasing subsequences and taking the first term of each.
Also the number of integer compositions of n matching the dashed pattern 1-32, ranked by A375137.
Also the number of integer compositions of n matching the dashed pattern 23-1, ranked by A375138.

Examples

			- The maximal weakly increasing runs of y = (1,1,3,2,1) are ((1,1,3),(2),(1)) with leaders (1,2,1) so y is counted under a(8). Also, y matches 1-32 and avoids 23-1.
- The maximal weakly increasing runs of y = (1,3,2,1,1) are ((1,3),(2),(1,1)) with leaders (1,2,1) so y is counted under a(8). Also, y matches 1-32 and avoids 23-1.
- The maximal weakly increasing runs of y = (2,3,1,1,1) are ((2,3),(1,1,1)) with leaders (2,1) so y is not counted under a(8). Also, y avoids 1-32 and matches 23-1.
- The maximal weakly increasing runs of y = (2,3,2,1) are ((2,3),(2),(1)) with leaders (2,2,1) so y is not counted under a(8). Also, y avoids 1-32 and matches 23-1.
- The maximal weakly increasing runs of y = (2,1,3,1,1) are ((2),(1,3),(1,1)) with leaders (2,1,1) so y is not counted under a(8). Also, y avoids both 1-32 and 23-1.
- The maximal weakly increasing runs of y = (2,1,1,3,1) are ((2),(1,1,3),(1)) with leaders (2,1,1) so y is not counted under a(8). Also, y avoids both 1-32 and 23-1.
The a(0) = 0 through a(8) = 10 compositions:
  .  .  .  .  .  .  (132)  (142)   (143)
                           (1132)  (152)
                           (1321)  (1142)
                                   (1232)
                                   (1322)
                                   (1421)
                                   (2132)
                                   (11132)
                                   (11321)
                                   (13211)
		

Crossrefs

The reverse version is the same.
For leaders of identical runs we have A056823.
The complement is counted by A189076.
The non-dashed version is A335514.
For leaders of anti-runs we have A374699, complement A374682.
For weakly decreasing runs we have the complement of A374747.
For leaders of strictly increasing runs we have A375135, complement A374697.
These compositions are ranked by A375137, reverse A375138.
A003242 counts anti-runs, ranks A333489.
A106356 counts compositions by number of maximal anti-runs.
A238279 counts compositions by number of maximal runs
A274174 counts contiguous compositions, ranks A374249.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n],!GreaterEqual@@First/@Split[#,LessEqual]&]],{n,0,15}]
    (* or *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],MatchQ[#,{_,y_,z_,_,x_,_}/;x
    				

Formula

a(n) = A011782(n) - A189076(n). - Jinyuan Wang, Feb 14 2025

Extensions

More terms from Jinyuan Wang, Feb 14 2025

A335485 Numbers k such that the k-th composition in standard order (A066099) is not weakly decreasing.

Original entry on oeis.org

6, 12, 13, 14, 20, 22, 24, 25, 26, 27, 28, 29, 30, 38, 40, 41, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 70, 72, 76, 77, 78, 80, 81, 82, 83, 84, 86, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106
Offset: 1

Views

Author

Gus Wiseman, Jun 18 2020

Keywords

Comments

Also compositions matching the pattern (1,2).
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The sequence of terms together with the corresponding compositions begins:
   6: (1,2)
  12: (1,3)
  13: (1,2,1)
  14: (1,1,2)
  20: (2,3)
  22: (2,1,2)
  24: (1,4)
  25: (1,3,1)
  26: (1,2,2)
  27: (1,2,1,1)
  28: (1,1,3)
  29: (1,1,2,1)
  30: (1,1,1,2)
  38: (3,1,2)
  40: (2,4)
		

Crossrefs

The complement A114994 is the avoiding version.
The (2,1)-matching version is A335486.
Patterns matching this pattern are counted by A002051 (by length).
Permutations of prime indices matching this pattern are counted by A335447.
These compositions are counted by A056823 (by sum).
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Non-unimodal compositions are counted by A115981 and ranked by A335373.
Combinatory separations are counted by A269134.
Patterns matched by standard compositions are counted by A335454.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    Select[Range[0,100],MatchQ[stc[#],{_,x_,_,y_,_}/;x
    				

A375137 Numbers k such that the k-th composition in standard order (row k of A066099) matches the dashed pattern 1-32.

Original entry on oeis.org

50, 98, 101, 114, 178, 194, 196, 197, 202, 203, 210, 226, 229, 242, 306, 324, 354, 357, 370, 386, 388, 389, 393, 394, 395, 402, 404, 405, 406, 407, 418, 421, 434, 450, 452, 453, 458, 459, 466, 482, 485, 498, 562, 610, 613, 626, 644, 649, 690, 706, 708, 709
Offset: 1

Views

Author

Gus Wiseman, Aug 09 2024

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
These are also numbers k such that the maximal weakly increasing runs in the k-th composition in standard order do not have weakly decreasing leaders, where the leaders of weakly increasing runs in a sequence are obtained by splitting it into maximal weakly increasing subsequences and taking the first term of each.
The reverse version (A375138) ranks compositions matching the dashed pattern 23-1.

Examples

			Composition 102 is (1,3,1,2), which matches 1-3-2 but not 1-32.
Composition 210 is (1,2,3,2), which matches 1-32 but not 132.
Composition 358 is (2,1,3,1,2), which matches 2-3-1 and 1-3-2 but not 23-1 or 1-32.
The terms together with corresponding compositions begin:
   50: (1,3,2)
   98: (1,4,2)
  101: (1,3,2,1)
  114: (1,1,3,2)
  178: (2,1,3,2)
  194: (1,5,2)
  196: (1,4,3)
  197: (1,4,2,1)
  202: (1,3,2,2)
  203: (1,3,2,1,1)
  210: (1,2,3,2)
  226: (1,1,4,2)
  229: (1,1,3,2,1)
  242: (1,1,1,3,2)
		

Crossrefs

The complement is too dense, but counted by A189076.
The non-dashed version is A335480, reverse A335482.
For leaders of identical runs we have A335485, reverse A335486.
For identical leaders we have A374633, counted by A374631.
Compositions of this type are counted by A374636.
For distinct leaders we have A374768, counted by A374632.
The reverse version is A375138, counted by A374636.
For leaders of strictly increasing runs we have A375139, counted by A375135.
Matching 1-21 also gives A375295, counted by A375140 (complement A188920).
A003242 counts anti-runs, ranks A333489.
A011782 counts compositions.
A238130, A238279, A333755 count compositions by number of runs.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Sum is A029837(n+1).
- Leader is A065120.
- Parts are listed by A066099, reverse A228351.
- Number of adjacent equal pairs is A124762, unequal A333382.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Run-length transform is A333627, sum A070939.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],MatchQ[stc[#],{_,x_,_,z_,y_,_}/;x
    				

A002051 Steffensen's bracket function [n,2].

Original entry on oeis.org

0, 0, 1, 9, 67, 525, 4651, 47229, 545707, 7087005, 102247051, 1622631549, 28091565547, 526858344285, 10641342962251, 230283190961469, 5315654681948587, 130370767029070365, 3385534663256714251, 92801587319328148989, 2677687796244383678827, 81124824998504072833245, 2574844419803190382447051
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of ways to arrange the blocks of the partitions of {1,2,...,n} in an undirected cycle of length 3 or more, see A000629. - Geoffrey Critzer, Nov 23 2012
From Gus Wiseman, Jun 24 2020: (Start)
Also the number of (1,2)-matching length-n sequences covering an initial interval of positive integers. For example, the a(2) = 1 and a(3) = 9 sequences are:
(1,2) (1,1,2)
(1,2,1)
(1,2,2)
(1,2,3)
(1,3,2)
(2,1,2)
(2,1,3)
(2,3,1)
(3,1,2)
Missing from this list are:
(1,1) (1,1,1)
(2,1) (2,1,1)
(2,2,1)
(3,2,1)
(End)

Examples

			a(4) = 9. There are 6 partitions of {1,2,3,4} into exactly three blocks and one way to put them in an undirected cycle of length three. There is one partition of {1,2,3,4} into four blocks and 3 ways to make an undirected cycle of length four. 6 + 3 = 9. - _Geoffrey Critzer_, Nov 23 2012
		

References

  • 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).
  • Steffensen, J. F. Interpolation. 2d ed. Chelsea Publishing Co., New York, N. Y., 1950. ix+248 pp. MR0036799 (12,164d)

Crossrefs

A diagonal of the triangular array in A241168.
(1,2)-avoiding patterns are counted by A011782.
(1,1)-matching patterns are counted by A019472.
(1,2)-matching permutations are counted by A033312.
(1,2)-matching compositions are counted by A056823.
(1,2)-matching permutations of prime indices are counted by A335447.
(1,2)-matching compositions are ranked by A335485.
Patterns are counted by A000670 and ranked by A333217.
Patterns matched by compositions are counted by A335456.

Programs

  • Mathematica
    a[n_] := Sum[ k!*StirlingS2[n-1, k], {k, 0, n-1}] - 2^(n-2); Table[a[n], {n, 3, 17}] (* Jean-François Alcover, Nov 18 2011, after Manfred Goebel *)
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],!GreaterEqual@@#&]],{n,0,5}] (* Gus Wiseman, Jun 24 2020 *)
  • PARI
    a(n) = sum(s=2, n-1, stirling(n,s+1,2)*s!/2); \\ Michel Marcus, Jun 24 2020

Formula

[n,2] = Sum_{s=2..n-1} Stirling2(n,s+1)*s!/2 (cf. A241168).
a(1)=0; for n >= 2, a(n) = A000670(n-1) - 2^(n-2). - Manfred Goebel (mkgoebel(AT)essex.ac.uk), Feb 20 2000; formula adjusted by N. J. A. Sloane, Apr 22 2014. For example, a(5) = 67 = A000670(4)-2^3 = 75-8 = 67.
E.g.f.: (1 - exp(2*x) - 2*log(2 - exp(x)))/4 = B(A(x)) where A(x) = exp(x)-1 and B(x) = (log(1/(1-x))- x - x^2/2)/2. - Geoffrey Critzer, Nov 23 2012

Extensions

Entry revised by N. J. A. Sloane, Apr 22 2014

A335486 Numbers k such that the k-th composition in standard order (A066099) is not weakly increasing.

Original entry on oeis.org

5, 9, 11, 13, 17, 18, 19, 21, 22, 23, 25, 27, 29, 33, 34, 35, 37, 38, 39, 41, 43, 44, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 59, 61, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99
Offset: 1

Views

Author

Gus Wiseman, Jun 18 2020

Keywords

Comments

Also compositions matching the pattern (2,1).
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The sequence of terms together with the corresponding compositions begins:
   5: (2,1)
   9: (3,1)
  11: (2,1,1)
  13: (1,2,1)
  17: (4,1)
  18: (3,2)
  19: (3,1,1)
  21: (2,2,1)
  22: (2,1,2)
  23: (2,1,1,1)
  25: (1,3,1)
  27: (1,2,1,1)
  29: (1,1,2,1)
  33: (5,1)
  34: (4,2)
  35: (4,1,1)
		

Crossrefs

The complement A225620 is the avoiding version.
The (1,2)-matching version is A335485.
Patterns matching this pattern are counted by A002051 (by length).
Permutations of prime indices matching this pattern are counted by A008480(n) - 1.
These compositions are counted by A056823 (by sum).
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Non-unimodal compositions are counted by A115981 and ranked by A335373.
Combinatory separations are counted by A269134.
Patterns matched by standard compositions are counted by A335454.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    Select[Range[0,100],MatchQ[stc[#],{_,x_,_,y_,_}/;x>y]&]
Showing 1-10 of 29 results. Next