cp's OEIS Frontend

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

Previous Showing 21-30 of 45 results. Next

A079862 a(i) = the number of occurrences of 9's in the palindromic compositions of n=2*i-1 = the number of occurrences of 10's in the palindromic compositions of n=2*i.

Original entry on oeis.org

18, 38, 80, 168, 352, 736, 1536, 3200, 6656, 13824, 28672, 59392, 122880, 253952, 524288, 1081344, 2228224, 4587520, 9437184, 19398656, 39845888, 81788928, 167772160, 343932928, 704643072, 1442840576, 2952790016, 6039797760, 12348030976, 25232932864
Offset: 10

Views

Author

Silvia Heubach (sheubac(AT)calstatela.edu), Jan 11 2003

Keywords

Comments

This sequence is part of a family of sequences, namely R(n,k), the number of ks in palindromic compositions of n. See also A057711, A001792, A078836, A079861, A079862. General formula: R(n,k)=2^(floor(n/2) - k) * (2 + floor(n/2) - k) if n and k have different parity and R(n,k)=2^(floor(n/2) - k) * (2 + floor(n/2) - k + 2^(floor((k+1)/2 - 1)) otherwise, for n >= 2k.

Examples

			a(10) = 18 since the palindromic compositions of 19 that contain a 9 are 9+1+9 and the 16 compositions of the form c+9+(reverse of c), where c represents a composition of 5.
		

Crossrefs

Programs

  • Mathematica
    Table[(8 + i)*2^(i - 10), {i, 10, 50}]
  • PARI
    Vec(-2*x^10*(17*x-9)/(2*x-1)^2 + O(x^100)) \\ Colin Barker, Sep 29 2015

Formula

a(n) = (n+8)*2^(n-10).
From Colin Barker, Sep 29 2015: (Start)
a(n) = 2*A159697(n-10).
a(n) = 4*a(n-1) - 4*a(n-2) for n>11.
G.f.: -2*x^10*(17*x-9) / (2*x-1)^2.
(End)

A129952 Binomial transform of A124625.

Original entry on oeis.org

1, 1, 2, 6, 16, 40, 96, 224, 512, 1152, 2560, 5632, 12288, 26624, 57344, 122880, 262144, 557056, 1179648, 2490368, 5242880, 11010048, 23068672, 48234496, 100663296, 209715200, 436207616, 905969664, 1879048192, 3892314112
Offset: 0

Views

Author

Paul Curtz, Jun 10 2007

Keywords

Comments

Essentially the same as A057711: a(n) = A057711(n) for n >= 1.
Number of permutations of length n>=0 avoiding the partially ordered pattern (POP) {1>2, 1>3} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first element is larger than the second and third elements. - Sergey Kitaev, Dec 08 2020

Crossrefs

Cf. A124625, A045623, A057711, A129953 (first differences), A129954 (second differences), A129955 (third differences).

Programs

  • Magma
    m:=15; S:=&cat[ [ 1, 2*i ]: i in [0..m] ]; [ &+[ Binomial(j-1, k-1)*S[k]: k in [1..j] ]: j in [1..2*m] ]; // Klaus Brockhaus, Jun 17 2007
    
  • Mathematica
    LinearRecurrence[{4, -4}, {1, 1, 2, 6}, 30] (* G. C. Greubel, Jun 08 2016; corrected by Georg Fischer, Apr 02 2019 *)
  • PARI
    {m=29; print1(1, ",", 1, ","); for(n=2, m, print1(n*2^(n-2), ","))} \\ Klaus Brockhaus, Jun 17 2007
    
  • Python
    def A129952(n): return n<1 else 1 # Chai Wah Wu, Oct 03 2024

Formula

a(0) = 1, a(1) = 1; for n > 1, a(n) = n*2^(n-2).
G.f.: (1-3*x+2*x^2+2*x^3)/(1-2*x)^2.
E.g.f.: (1/2)*(x*exp(2*x) + x + 2). - G. C. Greubel, Jun 08 2016

Extensions

Edited and extended by Klaus Brockhaus, Jun 17 2007

A229460 T(n,k) = number of defective 3-colorings of an n X k 0..2 array connected horizontally and vertically with exactly one mistake and colors introduced in row-major 0..2 order.

Original entry on oeis.org

0, 1, 1, 2, 4, 2, 6, 20, 20, 6, 16, 84, 140, 84, 16, 40, 324, 863, 863, 324, 40, 96, 1188, 4962, 7940, 4962, 1188, 96, 224, 4212, 27313, 68790, 68790, 27313, 4212, 224, 512, 14580, 145932, 573342, 903332, 573342, 145932, 14580, 512, 1152, 49572, 763031
Offset: 1

Views

Author

R. H. Hardin, Sep 24 2013

Keywords

Comments

Table starts
...0.....1......2........6.........16..........40............96.............224
...1.....4.....20.......84........324........1188..........4212...........14580
...2....20....140......863.......4962.......27313........145932..........763031
...6....84....863.....7940......68790......573342.......4651079........36985536
..16...324...4962....68790.....903332....11451686.....141595454......1718447506
..40..1188..27313...573342...11451686...221410052....4182294415.....77626332302
..96..4212.145932..4651079..141595454..4182294415..120864516084...3435347473308
.224.14580.763031.36985536.1718447506.77626332302.3435347473308.149656305350148

Examples

			Some solutions for n=3, k=4:
  0 1 0 2     0 1 0 2     0 1 0 2     0 1 0 2     0 1 0 2
  2 1 2 1     2 1 2 0     2 2 1 0     1 0 2 1     1 0 2 0
  0 2 1 2     1 2 1 2     0 1 2 1     2 0 1 0     1 2 0 2
		

Crossrefs

Column 1 is A057711(n-1).
Column 2 is A167682(n-1).

Formula

Empirical for column k:
k=1: a(n) = 4*a(n-1) - 4*a(n-2) for n > 4.
k=2: a(n) = 6*a(n-1) - 9*a(n-2) for n > 3.
k=3: a(n) = 10*a(n-1) - 29*a(n-2) + 20*a(n-3) - 4*a(n-4).
k=4: [order 6] for n > 7.
k=5: [order 10].
k=6: [order 14] for n > 15.
k=7: [order 26].
k=8: [order 38] for n > 39.

A079863 a(n) is the number of occurrences of 11s in the palindromic compositions of m=2*n-1 = the number of occurrences of 12s in the palindromic compositions of m=2*n.

Original entry on oeis.org

34, 70, 144, 296, 608, 1248, 2560, 5248, 10752, 22016, 45056, 92160, 188416, 385024, 786432, 1605632, 3276800, 6684672, 13631488, 27787264, 56623104, 115343360, 234881024, 478150656, 973078528, 1979711488, 4026531840, 8187281408, 16642998272, 33822867456
Offset: 12

Views

Author

Silvia Heubach (sheubac(AT)calstatela.edu), Jan 11 2003

Keywords

Comments

This sequence is part of a family of sequences, namely R(n,k), the number of ks in palindromic compositions of n. See also A057711, A001792, A078836, A079861, A079862. General formula: R(n,k)=2^(floor(n/2) - k) * (2 + floor(n/2) - k) if n and k have different parity and R(n,k)=2^(floor(n/2) - k) * (2 + floor(n/2) - k + 2^(floor((k+1)/2 - 1)) otherwise, for n >= 2k.

Examples

			a(12) = 34 since the palindromic compositions of 23 that contain a 11 are 11+1+11 and the 32 compositions of the form c+11+(reverse of c), where c represents a composition of 6.
		

Crossrefs

Programs

  • Mathematica
    Table[(22 + i)*2^(i - 12), {i, 12, 50}]
    LinearRecurrence[{4,-4},{34,70},30] (* Harvey P. Dale, Jan 30 2017 *)
  • PARI
    Vec(-2*x^12*(33*x-17)/(2*x-1)^2 + O(x^100)) \\ Colin Barker, Sep 29 2015
    
  • PARI
    a(n)=(n+22)<<(n-12) \\ Charles R Greathouse IV, Sep 29 2015

Formula

a(n) = (n+22)*2^(n-12).
From Colin Barker, Sep 29 2015: (Start)
a(n) = 4*a(n-1) - 4*a(n-2) for n>13.
G.f.: -2*x^12*(33*x-17) / (2*x-1)^2.
(End)

A263789 Triangle read by rows: T(n,k) (n>=0, 0<=k<=floor(n/2)) is the number of permutations of n and k valleys (considered cyclically).

Original entry on oeis.org

1, 1, 0, 2, 0, 6, 0, 16, 8, 0, 40, 80, 0, 96, 528, 96, 0, 224, 2912, 1904, 0, 512, 14592, 23040, 2176, 0, 1152, 69120, 221184, 71424, 0, 2560, 316160, 1858560, 1372160, 79360, 0, 5632, 1413632, 14353152, 20252672, 3891712, 0, 12288, 6223872, 104742912
Offset: 0

Views

Author

Christian Stump, Oct 26 2015

Keywords

Comments

Conjecture: column k > 0 is asymptotic to n * 2^(n-2*k) * k^(n-1). - Vaclav Kotesovec, Oct 26 2015

Examples

			Triangle begins:
  1;
  1;
  0,  2;
  0,  6;
  0, 16,   8;
  0, 40,  80;
  0, 96, 528, 96;
  ...
		

Crossrefs

Columns k=1-6 give: A057711 (for n>1), A159710, A159711, A159712, A159713, A159714.
Row sums give A000142.

Programs

  • Maple
    b:= proc(u, o, t) option remember; expand(`if`(u+o=0, x,
          add(b(u-j, o+j-1, 0), j=1..u)*`if`(min(t, n)>0, x, 1)+
          add(b(u+j-1, o-j, 1), j=1..o)))
        end:
    T:= n-> `if`(n<2, 1, (p-> seq(n*coeff(p, x, i)
            , i=0..degree(p)))(b(n-1, 0$2))):
    seq(T(n), n=0..14);  # Alois P. Heinz, Oct 28 2015
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = Expand[If[u+o == 0, x, Sum[b[u-j, o+j-1, 0], {j, 1, u}]*If[Min[t, n] > 0, x, 1] + Sum[b[u+j-1, o-j, 1], {j, 1, o}]]]; T[n_] := If[n<2, 1, Function[p, Table[n*Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n-1, 0, 0]]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 24 2017, after Alois P. Heinz *)

Formula

T(n,k) = n*A008303(n-1, k-1) for n > 1. - Andrew Howroyd, May 13 2020

Extensions

More terms from Alois P. Heinz, Oct 26 2015

A119458 Triangle read by rows: T(n,k) is the number of (marked) circular binary words of length n having k occurrences of 00 (0 <= k <= n).

Original entry on oeis.org

1, 1, 1, 3, 0, 1, 4, 3, 0, 1, 7, 4, 4, 0, 1, 11, 10, 5, 5, 0, 1, 18, 18, 15, 6, 6, 0, 1, 29, 35, 28, 21, 7, 7, 0, 1, 47, 64, 60, 40, 28, 8, 8, 0, 1, 76, 117, 117, 93, 54, 36, 9, 9, 0, 1, 123, 210, 230, 190, 135, 70, 45, 10, 10, 0, 1, 199, 374, 440, 396, 286, 187, 88, 55, 11, 11, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, May 20 2006

Keywords

Comments

Sum of entries in row n is 2^n (A000079).
In Carlitz and Scoville (p. 252) the first term is 2.
From Petros Hadjicostas, Jan 05 2019: (Start)
Note that T(n,k) is the number of marked circular binary words of length n having k occurrences of 00 (0 <= k <= n). Let W(n,k) be the number of binary necklaces (= unmarked 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. We have W(n, k) = A320341(n, k) for 0 <= k <= n.
Fortunately, since T(n=1, k=0) = 1 = T(n=1, k=1), the author of the sequence (indirectly) assumes 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 when k > n. Note that G(z,t) = Sum_{n,k >=0} T(n,k)*z^n*t^k = 1 - z*(d(1-A(z,t))/dz)/(1-A(z,t)), where A(z,t) = z*(t+1) + z^2*(1-t) is the "Flajolet-Soria polynomial (g.f.)" in z of some (difficult to find) linear combinatorial structure that is defined very abstractly at the beginning of their paper and in the book by Flajolet and Sedgewick (2009). (Since the series here converge for z and t close to 0, we have that 1-t is positive for all t in a "small" interval around 0.)
Using the theory in Flajolet and Soria (1991) and the one in Hadjicostas and Zhang (2018), we can prove that the g.f. of the numbers W(n,k) is F(z,t) = Sum_{n >= 1, k >= 0} W(n,k)*z^n*t^k = -Sum_{d>=1} (phi(d)/d)*log(1-A(z^d,t^d)). We can also prove that W(n,k) = (1/n)*Sum_{d|gcd(n,k)} phi(d)*T(n/d, k/d) for n>=1 and 0 <= k <= n. (We omit the details.)
For k=0, we get that T(n, k=0) = A000204(n) and W(n, k=0) = A000358(n) for n >= 1, and the Flajolet-Soria polynomial is A(z,t=0) = z + z^2 (which was discovered by Joerg Arndt).
To get univariate g.f.'s of the sequences (T(n,k): n >= 1) and (W(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.)
For k=1, we get T(n, k=1) = A006490(n) and W(n, k=1) = A212804(n-1) = A006490(n)/n for n >= 1.
For k=2, we get T(n, k=2) = A006491(n-1) for n >= 1 (with A006491(0) := 0) and W(n, k=2) = (1/n)*(T(n,2) + I(2|n)*T(n/2,1)) for n >= 1, where I(2|n) = 1 if 2|n, and 0 otherwise.
For k=3, we get T(n, k=3) = A006492(n-2) for n >=1 (with A006492(m) = 0 for m = 1,2) and W(n, k=3) = (1/n)*(T(n,3) + 2*I(3|n)*T(n/3, 1)) for n >= 1.
This theory can be generalized for any pattern P of 0's and 1's provided one discovers the correct "Flajolet-Soria" polynomial A_P(z,t). In other words, if P is a finite pattern of zeros and ones of length L, and we let T_P(n,k) be the number of (marked) circular binary words of length n having k occurrences of P (0 <= k <= n) and we allow strings of length n, with 1 <= n < L, to wrap around themselves on the circle to form a string of length n*ceiling(L/n), then (most probably) we can express the g.f. of T_p(n,k), say G_p(z,t), in the form 1-z*(d(1-A_P(z,t))/dz)/(1-A_P(z,t)). In such a case, if W_P(n,k) is the number of binary necklaces (= unmarked circular binary words) of length n with exactly k occurrences of the pattern P, we have that its generating function is Sum_{n >= 1, k >= 0} W_P(n,k)*z^n*t^k = -Sum_{d>=1} (phi(d)/d)*log(1-A_P(z^d,t^d)). We can also prove that W_P(n,k) = (1/n)*Sum_{d|gcd(n,k)} phi(d)*T_P(n/d, k/d) for n>=1 and 0 <= k <= n.
One final note: it seems that the theory of Flajolet and Soria (1991) applies only to the case k=0 and to the case we consider all k simultaneously. (For fixed k >= 2, W_P(n,k) depends not only on T_P(n,k), but also on all T(n/d, k/d) where d ranges over the common divisors of n and k. Thus, for fixed k >= 2, it seems there is no linear combinatorial structure whose list of cycles of elements corresponds to the collection of necklaces we want.) See also Flajolet and Sedgewick (2009), pp. 84-85 and 729-730.
(End)

Examples

			T(5,3) = 5 because we have 10000, 01000, 00100, 00010 and 00001.
Triangle for T(n,k) begins:
n=0:    1;
n=1:    1,   1;
n=2:    3,   0,   1;
n=3:    4,   3,   0,   1;
n=4:    7,   4,   4,   0,   1;
n=5:   11,  10,   5,   5,   0,  1
n=6:   18,  18,  15,   6,   6,  0,  1;
n=7:   29,  35,  28,  21,   7,  7,  0,  1;
n=8:   47,  64,  60,  40,  28,  8,  8,  0,  1;
n=9:   76, 117, 117,  93,  54, 36,  9,  9,  0, 1;
n=10: 123, 210, 230, 190, 135, 70, 45, 10, 10, 0, 1;
  ...
From _Petros Hadjicostas_, Jan 06 2019: (Start)
If we take the Taylor expansion of g.f. G(z,t) of T(n,k) around z=0, we get G(z,t) = 1 + (1+t)*z + (3+0*t+t^2)*z^2 + (4+3*t+0*t^2+t^3)*z^3 + (7+4*t+4*t^2+0*t^3+t^4)*z^4 +(11+10*t+5*t^2+5*t^3+0*t^4+t^5)*z^5 + ...
One the other hand, if we take the Taylor expansion of the g.f. F(z,t) of W(n,k) = A320341(n, k) around z=0, we get F(z,t) = (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 + ...
Triangle for W(n,k) begins:
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;
...
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], T(4,0) = 7 and W(4,0) = 3;
k=1: [1100,1001,0011,0110], T(4,1) = 4 and W(4,1) = 1;
k=2: [0001,0010,0100,1000], T(4,2) = 4 and W(4,2) = 1;
k=3: none, T(4,3) = 0 = W(4,3);
k=4: [0000], T(4,4) = 1 = W(4,4).
(End)
		

Crossrefs

Programs

  • Maple
    T:=proc(n,k): if k>n or k<0 then 0 elif n=0 and k=0 then 1 elif n=1 then 1 elif n=2 and k=0 then 3 elif n=2 and k=1 then 0 else T(n-1,k)+T(n-2,k)+T(n-1,k-1)-T(n-2,k-1) fi end: for n from 0 to 12 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k > n || k < 0, 0, n == 0 && k == 0, 1, n == 1, 1, n == 2 && k == 0, 3, n == 2 && k == 1, 0, True, T[n-1, k] + T[n-2, k] + T[n-1, k-1] - T[n-2, k-1]];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 11 2019 *)

Formula

T(n,k) = T(n-1,k) + T(n-2,k) + T(n-1,k-1) - T(n-2,k-1) for n >= 3 and k >= 1.
G.f.: G(z,t) = Sum_{n,k >=0} T(n,k)*z^n*t^k = (1 + z^2 - t*z^2)/(1 - z - z^2 - t*z + t*z^2). [edited by Petros Hadjicostas, Jan 05 2019]
T(n,0) = A000204(n) for n >= 1 (Lucas numbers).
T(n,1) = A006490(n) for n >= 1.
T(n,2) = A006491(n-1) for n >= 1 (with A006491(0):=0).
Sum_{k=0..n} k*T(n,k) = A057711(n).

Extensions

Name was edited by Petros Hadjicostas, Jan 06 2019
Values of T(9,5) and T(9,6) were corrected in the example by Petros Hadjicostas, Jan 06 2019

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).

A307796 Number T(n,k) of binary words of length n such that k is the difference of numbers of occurrences of subword 101 and subword 010; triangle T(n,k), n>=0, -floor(n/3)<=k<=floor(n/3), read by rows.

Original entry on oeis.org

1, 2, 4, 1, 6, 1, 2, 12, 2, 6, 20, 6, 1, 12, 38, 12, 1, 3, 28, 66, 28, 3, 10, 56, 124, 56, 10, 1, 24, 119, 224, 119, 24, 1, 4, 60, 236, 424, 236, 60, 4, 15, 134, 481, 788, 481, 134, 15, 1, 42, 304, 950, 1502, 950, 304, 42, 1, 5, 114, 656, 1902, 2838, 1902, 656, 114, 5
Offset: 0

Views

Author

Alois P. Heinz, Apr 29 2019

Keywords

Examples

			T(8,2) = 10: 01101101, 10101101, 10110101, 10110110, 10110111, 10111011, 10111101, 11011011, 11011101, 11101101.
T(8,-2) = 10: 00010010, 00100010, 00100100, 01000010, 01000100, 01001000, 01001001, 01001010, 01010010, 10010010.
T(9,3)  = 1: 101101101.
T(9,-3) = 1: 010010010.
Triangle T(n,k) begins:
  :                      1                   ;
  :                      2                   ;
  :                      4                   ;
  :                1,    6,   1              ;
  :                2,   12,   2              ;
  :                6,   20,   6              ;
  :           1,  12,   38,  12,   1         ;
  :           3,  28,   66,  28,   3         ;
  :          10,  56,  124,  56,  10         ;
  :      1,  24, 119,  224, 119,  24,  1     ;
  :      4,  60, 236,  424, 236,  60,  4     ;
  :     15, 134, 481,  788, 481, 134, 15     ;
  :  1, 42, 304, 950, 1502, 950, 304, 42, 1  ;
		

Crossrefs

Columns k=0-2 give: A164146, A284449, A286209.
Row sums give A000079.
T(3n-4,n-2) gives A000217 for n >= 3.

Programs

  • Maple
    b:= proc(n, t, h) option remember; `if`(n=0, 1, expand(
          `if`(h=3, 1/x, 1)*b(n-1, [1, 3, 1][t], 2)+
          `if`(t=3, x, 1)*b(n-1, 2, [1, 3, 1][h])))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=-iquo(n, 3)..iquo(n, 3)))(b(n, 1$2)):
    seq(T(n), n=0..15);
  • Mathematica
    b[n_, t_, h_] := b[n, t, h] = If[n == 0, 1, Expand[If[h == 3, 1/x, 1]* b[n-1, {1, 3, 1}[[t]], 2] + If[t == 3, x, 1]*b[n-1, 2, {1, 3, 1}[[h]]]]];
    T[n_] := Table[Coefficient[#, x, i], {i, -Quotient[n, 3], Quotient[n, 3]}]& @ b[n, 1, 1];
    Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, May 08 2019, after Alois P. Heinz *)

Formula

T(n,k) = T(n,-k).
Sum_{k = -floor(n/3)..floor(n/3)} T(n,k) * k^2/2 = A057711(n-2) for n > 1.

A059474 Triangle read by rows: T(n,k) is coefficient of z^n*w^k in 1/(1 - 2*z - 2*w + 2*z*w) read by rows in order 00, 10, 01, 20, 11, 02, ...

Original entry on oeis.org

1, 2, 2, 4, 6, 4, 8, 16, 16, 8, 16, 40, 52, 40, 16, 32, 96, 152, 152, 96, 32, 64, 224, 416, 504, 416, 224, 64, 128, 512, 1088, 1536, 1536, 1088, 512, 128, 256, 1152, 2752, 4416, 5136, 4416, 2752, 1152, 256, 512, 2560, 6784, 12160, 16032, 16032, 12160, 6784, 2560, 512
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2001; revised Jun 12 2005

Keywords

Comments

Pascal-like triangle: start with 1 at top; every subsequent entry is the sum of everything above you, plus 1.

Examples

			Triangle begins as:
   n\k [0]  [1]  [2]  [3]  [4]  [5]  [6] ...
  [0]   1;
  [1]   2,   2;
  [2]   4,   6,   4;
  [3]   8,  16,  16,   8;
  [4]  16,  40,  52,  40,  16;
  [5]  32,  96, 152, 152,  96,  32;
  [6]  64, 224, 416, 504, 416, 224,  64;
       ...
		

Crossrefs

See A059576 for a similar triangle.

Programs

  • Magma
    A059474:= func< n,k | (&+[(-1)^j*2^(n-j)*Binomial(n-k,j)*Binomial(n-j,n-k): j in [0..n-k]]) >;
    [A059474(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, May 21 2023
    
  • Maple
    read transforms; SERIES2(1/(1-2*z-2*w+2*z*w),x,y,12): SERIES2TOLIST(%,x,y,12);
    # Alternative
    T := (n, k) -> 2^n*binomial(n, k)*hypergeom([-k, -n + k], [-n], 1/2):
    for n from 0 to 10 do seq(simplify(T(n, k)), k = 0 .. n) end do; # Peter Luschny, Nov 26 2021
  • Mathematica
    Table[(-1)^k*2^n*JacobiP[k, -n-1,0,0], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 04 2017; May 21 2023 *)
  • SageMath
    def A059474(n,k): return 2^n*binomial(n, k)*simplify(hypergeometric([-k, k-n], [-n], 1/2))
    flatten([[A059474(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, May 21 2023

Formula

G.f.: 1/(1 - 2*z - 2*w + 2*z*w).
T(n, k) = Sum_{j=0..n} (-1)^j*2^(n + k - j)*C(n, j)*C(n + k - j, n).
T(n, 0) = T(n, n) = A000079(n).
T(2*n, n) = A084773(n).
T(n, k) = 2^n*binomial(n, k)*hypergeom([-k, k - n], [-n], 1/2). - Peter Luschny, Nov 26 2021
From G. C. Greubel, May 21 2023: (Start)
T(n, n-k) = T(n, k).
Sum_{k=0..n} T(n, k) = A007070(n).
Sum_{k=0..n} (-1)^k * T(n, k) = A077957(n).
T(n, 1) = A057711(n+1) = 2*A001792(n) - [n=0].
T(n, 2) = 4*A049611(n-1). (End)

A082133 Expansion of e.g.f. x*exp(2*x)*cosh(x).

Original entry on oeis.org

0, 1, 4, 15, 56, 205, 732, 2555, 8752, 29529, 98420, 324775, 1062888, 3454373, 11160268, 35872275, 114791264, 365897137, 1162261476, 3680494655, 11622614680, 36611236221, 115063885244, 360882185515, 1129718145936
Offset: 0

Views

Author

Paul Barry, Apr 06 2003

Keywords

Comments

Binomial transform of A057711. 2nd binomial transform of (0,1,0,3,0,5,0,7,...).

Crossrefs

Programs

  • GAP
    List([0..10^2], n->Sum([1..n], k->Sum([1..3], j->Stirling2(n,j)))); # Muniru A Asiru, Feb 06 2018
  • Magma
    [n*(1^(n-1) + 3^(n-1))/2: n in [0..30]]; // G. C. Greubel, Feb 05 2018
    
  • Maple
    with (combinat):seq(sum(sum(stirling2(n, j),j=1..3), k=1..n), n=0..24); # Zerinvary Lajos, Dec 04 2007
  • Mathematica
    With[{nn=30},CoefficientList[Series[x Exp[2x]Cosh[x],{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Apr 30 2012 *)
    Table[n*(1^(n-1) + 3^(n-1))/2, {n,0,30}] (* G. C. Greubel, Feb 05 2018 *)
    Table[Sum[Sum[StirlingS2[n,j], {j,1,3}], {k,1,n}], {n,0,30}] (* G. C. Greubel, Feb 07 2018 *)
  • PARI
    for(n=0,30, print1(n*(1^(n-1) + 3^(n-1))/2, ", ")) \\ G. C. Greubel, Feb 05 2018
    

Formula

a(n) = n*(1^(n-1) + 3^(n-1))/2.
E.g.f.: x*exp(2x)*cosh(x).
G.f.: x*(1-4*x+5*x^2) / ( (3*x-1)^2*(x-1)^2 ). - R. J. Mathar, Nov 24 2012
a(n) = Sum_{k=1..n} (Sum_{j=1..3} Stirling2(n,j)). - G. C. Greubel, Feb 07 2018

Extensions

Definition clarified by Harvey P. Dale, Apr 30 2012
Previous Showing 21-30 of 45 results. Next