cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-9 of 9 results.

A006367 Number of binary vectors of length n+1 beginning with 0 and containing just 1 singleton.

Original entry on oeis.org

1, 0, 2, 2, 5, 8, 15, 26, 46, 80, 139, 240, 413, 708, 1210, 2062, 3505, 5944, 10059, 16990, 28646, 48220, 81047, 136032, 228025, 381768, 638450, 1066586, 1780061, 2968040, 4944519, 8230370, 13689118, 22751528, 37786915, 62716752, 104028245
Offset: 0

Views

Author

David M. Bloom

Keywords

Comments

Number of compositions of n+1 containing exactly one 1. - Emeric Deutsch, Mar 08 2002
Number of permutations with one fixed point avoiding 231 and 321.
A singleton is a run of length 1. - Michael Somos, Nov 29 2014
Second column of A105422. - Michael Somos, Nov 29 2014
Number of weak compositions of n with one 0 and no 1's. Example: Combine one 0 with the compositions of 5 without 1 to get a(5) = 8 weak compositions: 0,5; 5,0; 0,2,3; 0,3,2; 2,0,3; 3,0,2; 2,3,0; 3,2,0. - Gregory L. Simay, Mar 21 2018

Examples

			a(4) = 5 because among the 2^4 compositions of 5 only 4+1,1+4,2+2+1,2+1+2,1+2+2 contain exactly one 1.
a(4) = 5 because the binary vectors of length 4+1 beginning with 0 and with exactly one singleton are: 00001, 00100, 00110, 01100, 01111. - _Michael Somos_, Nov 29 2014
G.f. = 1 + 2*x^2 + 2*x^3 + 5*x^4 + 8*x^5 + 15*x^6 + 26*x^7 + 46*x^8 + ...
		

Crossrefs

Programs

  • Magma
    I:=[1,0]; [n le 2 select I[n] else Self(n-1)+Self(n-2)+Fibonacci(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 20 2014
    
  • Mathematica
    nn=36; CoefficientList[Series[1/(1 -x/(1-x) +x)^2, {x, 0, nn}], x] (* Geoffrey Critzer, Feb 18 2014 *)
    a[n_]:= If[ n<0, SeriesCoefficient[((1-x)/(1+x-x^2))^2, {x, 0, -2-n}], SeriesCoefficient[((1-x)/(1-x-x^2))^2, {x, 0, n}]]; (* Michael Somos, Nov 29 2014 *)
  • PARI
    Vec( (1-x)^2/(1-x-x^2)^2 + O(x^66) ) \\ Joerg Arndt, Feb 20 2014
    
  • PARI
    {a(n) = if( n<0, n = -2-n; polcoeff( (1 - x)^2 / (1 + x - x^2)^2 + x * O(x^n), n), polcoeff( (1 - x)^2 / (1 - x - x^2)^2 + x * O(x^n), n))}; /* Michael Somos, Nov 29 2014 */
    
  • Python
    from sympy import fibonacci
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 1 if n==0 else 0 if n==1 else a(n - 1) + a(n - 2) + fibonacci(n - 3)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Jul 20 2017
    
  • SageMath
    def A006367(n): return (1/5)*(n*lucas_number2(n-2, 1, -1) + fibonacci(n+1) + 4*fibonacci(n-1))
    [A006367(n) for n in (0..40)] # G. C. Greubel, Apr 06 2022

Formula

a(n) = a(n-1) + a(n-2) + Fibonacci(n-3).
G.f.: (1-x)^2/(1-x-x^2)^2. - Emeric Deutsch, Mar 08 2002
a(n) = A010049(n+1) - A010049(n). - R. J. Mathar, May 30 2014
Convolution square of A212804. - Michael Somos, Nov 29 2014
a(n) = -(-1)^n * A004798(-1-n) for all n in Z. - Michael Somos, Nov 29 2014
0 = a(n)*(-2*a(n) - 7*a(n+1) + 2*a(n+2) + a(n+3)) + a(n+1)*(-4*a(n+1) + 10*a(n+2) - 2*a(n+3)) + a(n+2)*(+4*a(n+2) - 7*a(n+3)) + a(n+3)*(+2*a(n+3)) for all n in Z. - Michael Somos, Nov 29 2014
a(n) = (n*Lucas(n-2) + Fibonacci(n))/5 + Fibonacci(n-1). - Ehren Metcalfe, Jul 29 2017

A105423 Number of compositions of n+2 having exactly two parts equal to 1.

Original entry on oeis.org

1, 0, 3, 3, 9, 15, 31, 57, 108, 199, 366, 666, 1205, 2166, 3873, 6891, 12207, 21537, 37859, 66327, 115842, 201743, 350412, 607140, 1049545, 1810428, 3116655, 5355219, 9185349, 15728547, 26890375, 45904773, 78253896, 133221079
Offset: 0

Views

Author

Emeric Deutsch, Apr 07 2005

Keywords

Comments

Column 2 of A105422.

Examples

			a(4)=9 because we have (1,1,4),(1,4,1),(4,1,1),(1,1,2,2),(1,2,1,2),(1,2,2,1),(2,1,1,2),(2,1,2,1) and (2,2,1,1).
		

Crossrefs

Cf. A105422.

Programs

  • Maple
    G:=(1-z)^3/(1-z-z^2)^3: Gser:=series(G,z=0,42): 1,seq(coeff(Gser,z^n),n=1..40);
  • Mathematica
    LinearRecurrence[{3, 0, -5, 0, 3, 1}, {1, 0, 3, 3, 9, 15}, 40] (* Jean-François Alcover, Jul 23 2018 *)

Formula

G.f.: (1-z)^3/(1-z-z^2)^3.
a(n) = (1/50) [(5n^2+21n+25)*Lucas(n) - (11n^2+30n+10)*Fibonacci(n) ]. - Ralf Stephan, Jun 01 2007

A114320 Triangle T(n,k) = number of permutations of n elements with k 2-cycles.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 15, 6, 3, 75, 30, 15, 435, 225, 45, 15, 3045, 1575, 315, 105, 24465, 12180, 3150, 420, 105, 220185, 109620, 28350, 3780, 945, 2200905, 1100925, 274050, 47250, 4725, 945, 24209955, 12110175, 3014550, 519750, 51975, 10395, 290529855
Offset: 0

Views

Author

Vladeta Jovovic, Feb 05 2006

Keywords

Comments

Row n has 1+floor(n/2) terms. Row sums yield the factorials (A000142). Sum(k*T(n,k),k>0)=n!/2 for n>=2. - Emeric Deutsch, Feb 17 2006

Examples

			T(3,1) = 3 because we have (1)(23), (12)(3) and (13)(2).
Triangle begins:
    1;
    1;
    1,   1;
    3,   3;
   15,   6,   3;
   75,  30,  15;
  435, 225,  45,  15;
  ...
		

Crossrefs

Programs

  • Maple
    G:= exp((y-1)*x^2/2)/(1-x): Gser:= simplify(series(G,x=0,15)): P[0]:=1: for n from 1 to 12 do P[n]:= n!*coeff(Gser,x^n) od: for n from 0 to 12 do seq(coeff(y*P[n], y^j), j=1..1+floor(n/2)) od;  # yields sequence in triangular form - Emeric Deutsch, Feb 17 2006
  • Mathematica
    d = Exp[-x^2/2!]/(1 - x);f[list_] := Select[list, # > 0 &]; Flatten[Map[f, Transpose[Table[Range[0, 10]!CoefficientList[Series[x^(2 k)/(2^k k!) d, {x, 0, 10}], x], {k, 0, 5}]]]]  (* Geoffrey Critzer, Nov 29 2011 *)

Formula

E.g.f.: exp((y-1)*x^2/2)/(1-x). More generally, e.g.f. for number of permutations of n elements with k m-cycles is exp((y-1)*x^m/m)/(1-x).
T(n,k) = n!/(2^k*k!) * Sum_{j=0..floor(n/2)-k} (-1/2)^j/j!. - Alois P. Heinz, Nov 30 2011

Extensions

More terms from Emeric Deutsch, Feb 17 2006

A320341 Triangle read by rows: T(n,k) is the number of unmarked circular binary words (necklaces) of length n having k occurrences of the pattern 00 (n >= 0 and 0 <= k <= n).

Original entry on oeis.org

1, 1, 1, 2, 0, 1, 2, 1, 0, 1, 3, 1, 1, 0, 1, 3, 2, 1, 1, 0, 1, 5, 3, 3, 1, 1, 0, 1, 5, 5, 4, 3, 1, 1, 0, 1, 8, 8, 8, 5, 4, 1, 1, 0, 1, 10, 13, 13, 11, 6, 4, 1, 1, 0, 1, 15, 21, 24, 19, 14, 7, 5, 1, 1, 0, 1, 19, 34, 40, 36, 26, 17, 8, 5, 1, 1, 0, 1, 31, 55, 71, 67, 54, 34, 22, 9, 6, 1, 1, 0, 1
Offset: 0

Views

Author

Petros Hadjicostas, Jan 07 2019

Keywords

Comments

The array T(n,k) is the number of unmarked circular binary words (necklaces) of length n having exactly k occurrences of 00 (n >= 0 and 0 <= k <= n). Let V(n,k) be the number of marked circular binary words of length n with exactly k occurrences of the pattern 00 provided wrapping around the circle is allowed when n=1. More precisely, when n=1, we allow the string to wrap around itself on the circle to form a circular string of length 2. It turns out that V(n,k) = A119458(n,k). The properties of the array V(n,k) were studied by Carlitz and Scoville (1977).
Both for this array and for array V(n,k) = A119458(n,k) we have T(n=1, k=0) = T(n=1, k=1) = V(n=1, k=0) = V(n=1, k=1) = 1, which means in both arrays we (indirectly) assume that the string 0 has one occurrence of the pattern 00 (if allowed to wrap around itself on the circle only once), while the string 1 has zero occurrences of the pattern 00.
It makes sense to define T(n,k) = 0 = V(n,k) when k > n. Using the theory in Flajolet and Soria (1991), Flajolet and Sedgewick (2009), and Hadjicostas and Zhang (2018), we can prove that the g.f. of the numbers T(n,k) is F(z,t) = Sum_{n >= 0, k >= 0} T(n,k)*z^n*t^k = 1 - Sum_{d>=1} (phi(d)/d)*log(1-A(z^d,t^d)) while the g.f. of the numbers V(n,k) is K(z,t) = 1 - z*(d(1-A(z,t))/dz)/(1-A(z,t)), where A(z,t) = z*(t+1) + z^2*(1-t). (The latter g.f. was proved in Carlitz and Scoville (1977).)
We can also prove that T(n,k) = (1/n)*Sum_{d|gcd(n,k)} phi(d)*V(n/d, k/d) for n>=1 and 0 <= k <= n.
For k=0, we get that T(n, k=0) = A000358(n) and V(n, k=0) = A000204(n) and for n >= 1. To get univariate g.f.'s of the sequences (T(n,k): n >= 1) and (V(n, k): n >= 1) when k >= 1, we have to differentiate the previous two g.f.'s k times with respect to t, set t=0, and divide by k!. (Obviously, the log now disappears from the g.f. of T(n,k).)
For k=1, we get T(n, k=1) = A212804(n-1) = A006490(n)/n and V(n, k=1) = A006490(n) for n >= 1.
For k=2, we get T(n, k=2) = (1/n)*(V(n,2) + I(2|n)*V(n/2,1)) for n >= 1, where I(2|n) = 1 if 2|n, and 0 otherwise. Also, V(n, k=2) = A006491(n-1) for n >= 1 (with A006491(0) := 0).
For k=3, we get T(n, k=3) = (1/n)*(V(n,3) + 2*I(3|n)*V(n/3, 1)) for n >= 1. Also,
V(n, k=3) = A006492(n-2) for n >=1 (with A006492(m) = 0 for m = 1, 2). To get the g.f. for (T(n,k=3): n >= 0), we differentiate F(z,t) three times w.r.t. t, set t=0, and divide by 3! = 6. We get: 2*z^3*(1-z^3)/(3*(1-z^3-z^6)) + z^3*(1-z)^3/(3*(1-z-z^2)^3) = z^3 + 0*z^4 + z^5 + z^6 + 3*z^7 + 5*z^8 + 11*z^9 + 19*z^10 + 36*z^11 + 67*z^12 + 122*z^13 + 222*z^14 + ...
For 0 <= k <= n, T(n,k) - I(k=0) is the number of cyclic compositions of n with exactly k ones, where I(k=0) is 1 if k=0, and 0 otherwise. This can be proved using MacMahon's bijection between binary necklaces of length n and (unmarked) cyclic compositions of n. (We exclude the binary necklace consisting only of 1's, and that is why we need the term I(k=0).)
Given a binary necklace of 0's and 1's with length n (with at least one 0), starting with a 0 and going clockwise, let b_1 be the number of 1's until before the next zero plus one (for the initial 0); starting with the next zero, let b_2 be the number of 1's plus one (for the 2nd 0); continue this process until you reach the last 0 (say the m-th 0), and denote by b_m the number of 1's plus one before the first 0. Then b_1 + b_2 + ... + b_m is a cyclic composition of n. The process can be reversed (since b_1, b_2, ..., b_m >= 1). The only necklace that cannot be obtained from a cyclic composition is the one having all 1's, which we exclude. In the above process, b_i = 1 if and only if the i-th 0 in the above process is followed by 0 (to the right of it on the circle). Hence, for 0 <= k <= n, T(n,k) - I(k=0) is the number of cyclic compositions of n with exactly k ones.
Note that array A105422(n,k) is the linear version of this array: A105422(n,k) is the number of (linear) compositions of n having exactly k parts equal to 1. The denominator of the bivariate g.f. of array A105422(n,k) is indeed 1 - A(z,t), where A(z,t) = z*(t+1) + z^2*(1-t) (see above), and this is no coincidence.

Examples

			Triangle for T(n,k) begins:
n=0:    1;
n=1:    1,  1;
n=2:    2,  0,  1;
n=3:    2,  1,  0,  1;
n=4:    3,  1,  1,  0,  1;
n=5:    3,  2,  1,  1,  0,  1;
n=6:    5,  3,  3,  1,  1,  0,  1;
n=7:    5,  5,  4,  3,  1,  1,  0,  1;
n=8:    8,  8,  8,  5,  4,  1,  1,  0,  1;
n=9:   10, 13, 13, 11,  6,  4,  1,  1,  0, 1;
n=10:  15, 21, 24, 19, 14,  7,  5,  1,  1, 0, 1;
...
If we take the Taylor expansion of g.f. F(z,t) of T(n,k) around z=0, we get F(z,t) = 1 + (1+t)*z + (2+0*t+t^2)*z^2 + (2+t+0*t^2+t^3)*z^3 + (3+t+t^2+0*t^3+t^4)*z^4 + (3+2*t+t^2+t^3+0*t^4+t^5)*z^5 + ...
For example, for n=4, we have the following marked and unmarked circular binary words (the square brackets denote equivalence classes):
k=0: [1111], [1110,1101,1011,0111], [1010,0101], V(4,0) = 7 and T(4,0) = 3;
k=1: [1100,1001,0011,0110], V(4,1) = 4 and T(4,1) = 1;
k=2: [0001,0010,0100,1000], V(4,2) = 4 and T(4,2) = 1;
k=3: none, V(4,3) = 0 = T(4,3);
k=4: [0000], V(4,4) = 1 = T(4,4).
The corresponding cyclic compositions of n=4 under MacMahon's bijection are the following:
k=0 (no 1's): [none], [4], [2+2], T(4,1) - 1 = 3 - 1 = 2;
k=1 (one 1): [1+3], T(4,1) = 1;
k=2 (two 1's): [1+1+2], T(4,2) = 1;
k=3 (three 1's): none, T(4,3) = 0;
k=4 (four 1's): [1+1+1+1], T(4,4) = 1.
		

Crossrefs

Formula

T(n,k) = (1/n)*Sum_{d|gcd(n,k)} phi(d)*A119458(n/d, k/d) for n>=1 and 0 <= k <= n.
G.f.: F(z,t) = Sum_{n >= 0, k >= 0} T(n,k)*z^n*t^k = 1 - Sum_{d>=1} (phi(d)/d)*log(1-A(z^d,t^d)), where A(z,t) = z*(t+1) + z^2*(1-t).

A113979 Number of compositions of n with an even number of 1's.

Original entry on oeis.org

1, 0, 2, 1, 6, 6, 20, 28, 72, 120, 272, 496, 1056, 2016, 4160, 8128, 16512, 32640, 65792, 130816, 262656, 523776, 1049600, 2096128, 4196352, 8386560, 16781312, 33550336, 67117056, 134209536, 268451840, 536854528, 1073774592, 2147450880
Offset: 0

Views

Author

Vladeta Jovovic, Jan 31 2006

Keywords

Comments

More generally, the g.f. for the number of compositions such that part m occurs with even multiplicity is (1-x)/(1-2*x)*(1-2*x+x^m-x^(m+1))/(1-2*x+2*x^m-2*x^(m+1)). - Vladeta Jovovic, Sep 01 2007

Examples

			a(4)=6 because the compositions of 4 having an even number of 1's are 4,22,211,121,112 and 1111 (the other compositions of 4 are 31 and 13).
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n mod 2 = 0 then 2^(n-2)+2^((n-2)/2) else 2^(n-2)-2^((n-3)/2) fi end: seq(a(n),n=1..38); # Emeric Deutsch, Feb 01 2006
  • Mathematica
    f[n_] := If[ EvenQ[n], 2^(n - 2) + 2^((n - 2)/2), 2^(n - 2) - 2^((n - 3)/2)]; Array[f, 34] (* Robert G. Wilson v, Feb 01 2006 *)
  • PARI
    a(n) = n-=2; (n==-2) + 1<=0, (-1)^n << (n>>1)); \\ Kevin Ryde, May 02 2023

Formula

a(0) = 1, a(n) = 2^(n-2) + 2^((n-2)/2) if n is positive and even, otherwise a(n) = 2^(n-2) - 2^((n-3)/2).
G.f.: (1-z)*(1-z-z^2)/((1-2*z)*(1-2*z^2)). - Emeric Deutsch, Feb 03 2006
E.g.f.: (1 + exp(2*x) - sqrt(2)*sinh(x*sqrt(2)) + 2*cosh(x*sqrt(2)))/4. - Sergei N. Gladkovskii, Nov 18 2011
a(k) = (1/4)*0^k + (1/4)*2^k + (1/8)*(2-sqrt(2))*(sqrt(2))^k + (1/8)*(2+sqrt(2))*(-sqrt(2))^k. - Sergei N. Gladkovskii, Nov 18 2011

Extensions

More terms from Robert G. Wilson v and Emeric Deutsch, Feb 01 2006
a(0)=1 prepended and formulas corrected by Jason Yuen, Sep 09 2024

A222763 Number of n X 2 0..1 arrays with exactly floor(nX2/2) elements unequal to at least one horizontal or antidiagonal neighbor, with new values introduced in row major 0..1 order.

Original entry on oeis.org

1, 0, 3, 4, 20, 48, 175, 512, 1719, 5400, 17776, 57420, 188656, 617176, 2033175, 6697744, 22139780, 73262232, 242931321, 806516560, 2681475048, 8925158440, 29740390672, 99196158144, 331163178475, 1106489052968, 3699881730900, 12380449027324, 41454579098852
Offset: 0

Views

Author

R. H. Hardin, Mar 05 2013

Keywords

Comments

From Gus Wiseman, Oct 05 2022: (Start)
Conjecture: Also the number of integer compositions of 2n + 1 with the same length as reverse-alternating sum. Here, the reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^i y_i. For example, the a(4) = 20 compositions are:
(135) (234) (333) (432) (531)
(11115) (21114) (31113) (41112) (51111)
(11214) (21213) (31212) (41211)
(11313) (21312) (31311)
(11412) (21411)
(11511)
This is the odd-indexed version of A357182, and the corresponding unordered count (partitions) is A357488.
(End)

Examples

			All solutions for n=3
..0..1....0..0....0..0....0..0
..0..0....0..0....0..1....1..0
..0..0....1..0....0..0....0..0
		

Crossrefs

Column k = 2 of A222769.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, [1, 0, 3][n+1],
          (4*(n-1)*(74*n^2-153*n+73)*a(n-1) +8*(2*n-3)*
          (74*n^2-153*n+70)*a(n-2) -2*(37*n-21)*(2*n-5)*
          (n-1)*a(n-3))/(5*(37*n-58)*n*(n-1)))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 24 2024

Formula

a(n) = A105422(2n,n). - Alois P. Heinz, Sep 24 2024
a(n) = (n+1)*A046736(n+2). - Mark van Hoeij, Nov 29 2024

Extensions

a(0)=1 prepended by Alois P. Heinz, Sep 24 2024

A383101 Number of compositions of n such that any part 1 can be m different colors where m is the largest part of the composition.

Original entry on oeis.org

1, 1, 2, 6, 21, 77, 294, 1178, 4978, 22191, 104146, 513385, 2653003, 14349804, 81125023, 478686413, 2943737942, 18838530436, 125268429098, 864256288435, 6177766228172, 45689641883377, 349173454108407, 2754058599745239, 22393206702946457, 187501022603071090
Offset: 0

Views

Author

John Tyler Rascoe, Apr 16 2025

Keywords

Examples

			a(3) = 6 counts: (3), (2,1_a), (2,1_b), (1_a,2), (1_b,2), (1_a,1_a,1_a).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p, m) option remember; binomial(n+p, n)*
          m^n+add(b(n-j, p+1, max(m, j)), j=2..n)
        end:
    a:= n-> b(n, 0, 1):
    seq(a(n), n=0..25);  # Alois P. Heinz, Apr 23 2025
  • PARI
    A_x(N) = {my(x='x+O('x^N)); Vec(1+sum(m=1,N, x^m/((1-m*x-(x^2-x^m)/(1-x))*(1-m*x-(x^2-x^(m+1))/(1-x)))))}
    A_x(30)

Formula

G.f.: 1 + Sum_{m>0} x^m/((1 - m*x - (x^2 - x^m)/(1 - x)) * (1 - m*x - (x^2 - x^(m+1))/(1 - x))).

A113980 Number of compositions of n with an odd number of 1's.

Original entry on oeis.org

1, 0, 3, 2, 10, 12, 36, 56, 136, 240, 528, 992, 2080, 4032, 8256, 16256, 32896, 65280, 131328, 261632, 524800, 1047552, 2098176, 4192256, 8390656, 16773120, 33558528, 67100672, 134225920, 268419072, 536887296, 1073709056, 2147516416
Offset: 1

Views

Author

Vladeta Jovovic, Jan 31 2006

Keywords

Examples

			a(4)=2 because only the compositions 31 and 13 of 4 have an odd number of 1's (the other compositions are 4,22,211,121,112 and 1111).
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n mod 2 = 0 then 2^(n-2)-2^((n-2)/2) else 2^(n-2)+2^((n-3)/2) fi end: seq(a(n),n=1..38); # Emeric Deutsch, Feb 01 2006
  • Mathematica
    f[n_] := If[EvenQ[n], 2^(n - 2) - 2^((n - 2)/2), 2^(n - 2) + 2^((n - 3)/2)]; Array[f, 34] (* Robert G. Wilson v, Feb 01 2006 *)

Formula

a(n) = 2^(n-2)-2^((n-2)/2) if n is even, else a(n) = 2^(n-2)+2^((n-3)/2).
G.f.: z(1-z)^2/[(1-2z)(1-2z^2)]. - Emeric Deutsch, Feb 03 2006
G.f.: 1 + x + Q(0), where Q(k)= 1 - 1/(2^k - 2*x*2^(2*k)/(2*x*2^k - 1/(1 + 1/(2*2^k - 8*x*2^(2*k)/(4*x*2^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013

Extensions

More terms from Robert G. Wilson v and Emeric Deutsch, Feb 01 2006

A296559 Triangle read by rows: T(n,k) is the number of compositions of n having k parts equal to 1 or 2 (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 0, 2, 1, 1, 2, 1, 3, 1, 1, 4, 3, 3, 4, 1, 2, 4, 9, 5, 6, 5, 1, 3, 7, 12, 16, 9, 10, 6, 1, 4, 13, 18, 28, 26, 16, 15, 7, 1, 6, 19, 36, 42, 55, 41, 27, 21, 8, 1, 9, 29, 60, 82, 90, 97, 64, 43, 28, 9, 1, 13, 47, 94, 152, 170, 177, 160, 99, 65, 36, 10, 1, 19, 73, 158, 252, 335, 333, 323, 253, 151, 94, 45, 11, 1
Offset: 0

Views

Author

Emeric Deutsch, Dec 15 2017

Keywords

Comments

Sum of entries in row n = 2^{n-1} = A011782(n) (n>=1).
Sum(kT(n,k), k>=0) = (3n+5)*2^{n-4} = A106472(n-1) (n>=3).

Examples

			T(3,2) = 2 because we have [1,2],[2,1].
T(6,3) = 5 because we have [2,2,2],[1,1,1,3],[1,1,3,1],[1,3,1,1],[3,1,1,1].
Triangle begins:
  1,
  0, 1,
  0, 1, 1,
  1, 0, 2, 1,
  1, 2, 1, 3, 1,
  1, 4, 3, 3, 4, 1,
  2, 4, 9, 5, 6, 5, 1,
  3, 7, 12, 16, 9, 10, 6, 1,
  4, 13, 18, 28, 26, 16, 15, 7, 1,
  ...
		

Crossrefs

Programs

  • Maple
    g := (1-x)/(1-(1+t)*x-(1-t)*x^3): gser := simplify(series(g, x = 0, 17)): for n from 0 to 15 do p[n] := sort(expand(coeff(gser, x, n))) end do: for n from 0 to 15 do seq(coeff(p[n], t, j), j = 0 .. n) end do; # yields sequence in triangular form
  • Mathematica
    nmax = 12;
    s = Series[(1-x)/(1 - (1+t) x - (1-t) x^3), {x, 0, nmax}, {t, 0, nmax}];
    T[n_, k_] := SeriesCoefficient[s, {x, 0, n}, {t, 0, k}];
    Table[T[n, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 16 2017 *)

Formula

G.f.: G(t,x) = (1-x)/(1 - (1 + t)x - (1 - t)x^3).
Showing 1-9 of 9 results.