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 11-20 of 85 results. Next

A175654 Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).

Original entry on oeis.org

1, 2, 6, 14, 36, 86, 210, 500, 1194, 2822, 6660, 15638, 36642, 85604, 199626, 464630, 1079892, 2506550, 5811762, 13462484, 31159914, 72071654, 166599972, 384912086, 888906306, 2052031172, 4735527306, 10925175254, 25198866036, 58108609526, 133973643090
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010; edited Jun 21 2013

Keywords

Comments

a(n) represents the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7 or 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the center square the bishop flies into a rage and turns into a raging elephant.
In chaturanga, the old Indian version of chess, one of the pieces was called gaja, elephant in Sanskrit. The Arabs called the game shatranj and the elephant became el fil in Arabic. In Spain chess became chess as we know it today but surprisingly in Spanish a bishop isn't a Christian bishop but a Moorish elephant and it still goes by its original name of el alfil.
On a 3 X 3 chessboard there are 2^9 = 512 ways for an elephant to fly into a rage on the central square (off the center the piece behaves like a normal bishop). The elephant is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the corner squares the 512 elephants lead to 46 different elephant sequences, see the overview of elephant sequences and the crossreferences.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the central square to A175655.

References

  • Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.
  • David Hooper and Kenneth Whyld, The Oxford Companion to Chess, pp. 74, 366, 1992.

Crossrefs

Cf. Elephant sequences corner squares [decimal value A[5]]: A040000 [0], A000027 [16], A000045 [1], A094373 [2], A000079 [3], A083329 [42], A027934 [11], A172481 [7], A006138 [69], A000325 [26], A045623 [19], A000129 [21], A095121 [170], A074878 [43], A059570 [15], A175654 [71, this sequence], A026597 [325], A097813 [58], A057711 [27], 2*A094723 [23; n>=-1], A002605 [85], A175660 [171], A123203 [186], A066373 [59], A015518 [341], A134401 [187], A093833 [343].

Programs

  • Magma
    [n le 3 select Factorial(n) else 3*Self(n-1) +Self(n-2) -6*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 08 2021
    
  • Maple
    nmax:=28; m:=1; A[1]:=[0,0,0,0,1,0,0,0,1]: A[2]:=[0,0,0,1,0,1,0,0,0]: A[3]:=[0,0,0,0,1,0,1,0,0]: A[4]:=[0,1,0,0,0,0,0,1,0]: A[5]:=[0,0,1,0,0,0,1,1,1]: A[6]:=[0,1,0,0,0,0,0,1,0]: A[7]:=[0,0,1,0,1,0,0,0,0]: A[8]:=[0,0,0,1,0,1,0,0,0]: A[9]:=[1,0,0,0,1,0,0,0,0]: A:=Matrix([A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{3,1,-6}, {1,2,6}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2012 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -6,1,3]^n*[1;2;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
    
  • Sage
    [( (1-x-x^2)/((1-2*x)*(1-x-3*x^2)) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Dec 08 2021

Formula

G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=2 and a(2)=6.
a(n) = ((6+10*A)*A^(-n-1) + (6+10*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n) - A006130(n-1)*sqrt(13)).
a(n) = b(n) - b(n-1) - b(n-2), where b(n) = Sum_{k=1..n} Sum_{j=0..k} binomial(j,n-3*k+2*j)*(-6)^(k-j)*binomial(k,j)*3^(3*k-n-j), n>0, b(0)=1, with a(0) = b(0), a(1) = b(1) - b(0). - Vladimir Kruchinin, Aug 20 2010
a(n) = 2*A006138(n) - 2^n = 2*(A006130(n) + A006130(n-1)) - 2^n. - G. C. Greubel, Dec 08 2021
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 3*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Feb 12 2023

A048004 Triangular array read by rows: T(n,k) = number of binary vectors of length n whose longest run of consecutive 1's has length k, for n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 7, 5, 2, 1, 1, 12, 11, 5, 2, 1, 1, 20, 23, 12, 5, 2, 1, 1, 33, 47, 27, 12, 5, 2, 1, 1, 54, 94, 59, 28, 12, 5, 2, 1, 1, 88, 185, 127, 63, 28, 12, 5, 2, 1, 1, 143, 360, 269, 139, 64, 28, 12, 5, 2, 1, 1, 232, 694, 563, 303, 143, 64, 28, 12, 5, 2, 1, 1, 376, 1328, 1167, 653, 315, 144, 64, 28, 12, 5, 2, 1
Offset: 0

Views

Author

Keywords

Comments

Equivalently, number of compositions of n+1 having largest part (exactly) k+1. Example: T(4,2)=5 because we have 3+2, 2+3, 3+1+1, 1+3+1 and 1+1+3. - Emeric Deutsch, Apr 01 2005
Here is a bijection between the binary words and the compositions: prefix the vector with a 0, place a comma before each 0, then read the lengths of the runs. Example: 1100 -> 01100 -> ,011,0,0 -> 311 -> 3+1+1. - N. J. A. Sloane, Apr 03 2011
A formula based on the conjugates of the partitions of n with largest part k is given as a Sage program below. Note that it gives the compositions in the natural enumeration 'n with largest part k'. The 'conjugate' formula leads to A097805. - Peter Luschny, Jul 13 2015

Examples

			Triangle begins:
1;
1,  1;
1,  2,   1;
1,  4,   2,   1;
1,  7,   5,   2,  1;
1, 12,  11,   5,  2,  1;
1, 20,  23,  12,  5,  2,  1;
1, 33,  47,  27, 12,  5,  2, 1;
1, 54,  94,  59, 28, 12,  5, 2, 1;
1, 88, 185, 127, 63, 28, 12, 5, 2, 1;
...
Example: T(4,2) = 5 because we have 1100, 1101, 0110, 0011, 1011.
		

References

  • J. Kappraff, Beyond Measure, World Scientific, 2002; see pp. 471-472.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 155.

Crossrefs

See A126198 and A048887 for closely related arrays.
T(n,2) = Fibonacci(n+2) - 1, A000071, T(n,3) = b(n) for n=3, 4, ..., where b=A000100, T(n,4) = c(n) for n = 4, 5, ..., where c=A000102.
Nonnegative elements of columns approach A045623.

Programs

  • Haskell
    tri n k | (k < 0) || (k > n) = 0
            | (k == 0) || (k == n) = 1
            | otherwise = 2*tri (n-1) k + tri (n-1) (k-1) - 2*tri (n-2) (k-1)
                                + tri (n-k-1) (k-1) - tri (n-k-2) k
    -- Valentin Hübner, Jul 20 2017, after David W. Wilson
  • Maple
    G:=k->(1-x)^2*x^k/(1-2*x+x^(k+1))/(1-2*x+x^(k+2)): for k from 0 to 14 do g[k]:=series(G(k),x=0,15) od: 1,seq(seq(coeff(g[k],x^n),k=0..n),n=1..12); # Emeric Deutsch, Apr 01 2005
    # second Maple program:
    B:= proc(n, k) option remember; `if`(n=0 or k=1, 1,
          add (B(n-j, k), j=1..min(n, k)))
        end:
    T:= (n, k)-> B(n+1, k+1)-B(n+1, k):
    seq(seq(T(n, k), k=0..n), n=0..14); # Alois P. Heinz, May 21 2013
  • Mathematica
    nn=10;f[list_]:=Select[list,#>0&];Map[f,Transpose[Table[ CoefficientList[ Series[(1-x^k)/(1-2x+x^(k+1))-(1-x^(k-1))/ (1-2x+x^k),{x,0,nn}],x],{k,1,nn}]]]//Grid  (* Geoffrey Critzer, Jan 13 2013 *)
    B[n_, k_] := B[n, k] = If[n==0 || k==1, 1, Sum[B[n-j, k], {j, 1, Min[n, k]} ]]; T[n_, k_] := B[n+1, k+1] - B[n+1, k]; Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 01 2015, after Alois P. Heinz *)
  • Python
    # See Richard Southern link.
    
  • Sage
    # Computes the triangle obtained by augmenting T(n,k) by appending the column
    # 1,0,0,0,... on the left. Illustrates a basic partition formula, is not
    # efficient as a program for large n.
    def A048004_row(n):
        r = []
        for k in (0..n):
            s = 0
            for p in Partitions(n, max_part=k, inner=[k]):
                q = p.conjugate()
                s += mul(binomial(q[j],q[j+1]) for j in range(len(q)-1))
            r.append(s)
        return r
    [A048004_row(n) for n in (0..9)] # Peter Luschny, Jul 13 2015
    

Formula

T(n, k) = 0 if k < 0 or k > n, 1 if k = 0 or k = n, 2T(n-1, k) + T(n-1, k-1) - 2T(n-2, k-1) + T(n-k-1, k-1) - T(n-k-2, k) otherwise. - David W. Wilson
T(n, k) = A048887(n+1, k+1) - A048887(n+1, k). - Henry Bottomley, Oct 29 2002
G.f. for column k: (1-x)^2*x^k/((1-2*x+x^(k+1))*(1-2*x+x^(k+2))). - Emeric Deutsch, Apr 01 2005
From Gary W. Adamson, Jun 23 2012: (Start)
Create an array of rows such that row 0 is the INVERT transform of (1,0,0,0,...); row 1 is the INVERT transform of (1,1,0,0,0,...); row 2 is the INVERT transform of (1,1,1,0,0,0,...) and so on:
1, 1, 1, 1, 1, 1, ...
1, 2, 3, 5, 8, 13, ...
1, 2, 4, 7, 13, 24, ...
1, 2, 4, 8, 15, 29, ...
... Then, take finite differences of column terms from the top -> down. Row terms of the triangle are finite differences of the array columns. (End)
T(n,k) = A126198(n+1,k+1) - A126198(n+1,k). - L. Edson Jeffery, May 21 2013
Recurrence: T(n+1,k) = Sum_{h=0..k} T(n-k, h) + Sum_{i=n-k+1..n} T(i, k); for example, T(7,3) = Sum_{h=0..3} T(3,h) + Sum_{i=4..6} T(i,3) or T(7,3) = (1+4+2+1) + (2+5+12) = 27. Example: T(4,2) = (1+1) + (1+2) = 5. - Richard Southern, Jul 09 2017
Difference between higher order Fibonacci numbers is equal to recurrence. T(n+1,k) = A126198 (n+1,k) - A126198 (n+1,k-1) = Sum_{i=n-k..n} A126198 (i,k) - Sum_{i=n-k+1..n} A126198 (i,k-1) = A126198 (n-k,k) + Sum_{i=n-k+1..n} (A126198 (i,k) - A126198 (i,k-1)) = Sum_{h=0..k} T(n-k, h) + Sum_{i=n-k+1..n} T(i, k). For example T(7,3) = A126198 (7,3) - A126198 (7,2) = 108 - 81 = (8+15+29+56) - (13+24+44) = 8 + (15-13) + (29-24) + (56-44) = 8 + (2+5+12) = (1+4+2+1) + (2+5+12). - Richard Southern, Aug 04 2017

Extensions

More terms from Emeric Deutsch, Apr 01 2005
Edited by N. J. A. Sloane, Apr 03 2011

A058396 Expansion of ((1-x)/(1-2*x))^3.

Original entry on oeis.org

1, 3, 9, 25, 66, 168, 416, 1008, 2400, 5632, 13056, 29952, 68096, 153600, 344064, 765952, 1695744, 3735552, 8192000, 17891328, 38928384, 84410368, 182452224, 393216000, 845152256, 1811939328, 3875536896, 8271167488, 17616076800
Offset: 0

Views

Author

Henry Bottomley, Nov 24 2000

Keywords

Comments

If X_1,X_2,...,X_n are 2-blocks of a (2n+3)-set X then, for n>=1, a(n+1) is the number of (n+2)-subsets of X intersecting each X_i, (i=1,2,...,n). - Milan Janjic, Nov 18 2007
Equals row sums of triangle A152230. - Gary W. Adamson, Nov 29 2008
a(n) is the number of weak compositions of n with exactly 2 parts equal to 0. - Milan Janjic, Jun 27 2010
Except for an initial 1, this is the p-INVERT of (1,1,1,1,1,...) for p(S) = (1 - S)^3; see A291000. - Clark Kimberling, Aug 24 2017

Crossrefs

Cf. A045623, A001793, A152230. A diagonal of A058395.

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(((1-x)/(1-2*x))^3)); // G. C. Greubel, Oct 16 2018
  • Maple
    seq(coeff(series(((1-x)/(1-2*x))^3,x,n+1), x, n), n = 0 .. 30); # Muniru A Asiru, Oct 16 2018
  • Mathematica
    CoefficientList[ Series[(1 - x)^3/(1 - 2x)^3, {x, 0, 28}], x] (* Robert G. Wilson v, Jun 28 2005 *)
    Join[{1},LinearRecurrence[{6,-12,8},{3,9,25},40]] (* Harvey P. Dale, Oct 17 2011 *)
  • PARI
    Vec((1-x)^3/(1-2*x)^3+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
    

Formula

a(n) = (n+2)*(n+7)*2^(n-4) for n > 0.
a(n) = Sum_{k=0..floor((n+2)/2)} C(n+2, 2k)*k(k+1)/2. - Paul Barry, May 15 2003
Binomial transform of quarter squares A002620 (without leading zeros). - Paul Barry, May 27 2003
a(n) = Sum_{k=0..n} C(n, k)*floor((k+2)^2/4). - Paul Barry, May 27 2003
a(n) = 6*a(n-1) - 12*a(n-2) + 8*a(n-3), n > 3. - Harvey P. Dale, Oct 17 2011
From Amiram Eldar, Jan 05 2022: (Start)
Sum_{n>=0} 1/a(n) = 145189/525 - 1984*log(2)/5.
Sum_{n>=0} (-1)^n/a(n) = 30103/175 - 2112*log(3/2)/5. (End)
E.g.f.: (1 + exp(2*x)*(7 + 10*x + 2*x^2))/8. - Stefano Spezia, Feb 01 2025

A030267 Compose the natural numbers with themselves, A(x) = B(B(x)) where B(x) = x/(1-x)^2 is the generating function for natural numbers.

Original entry on oeis.org

1, 4, 14, 46, 145, 444, 1331, 3926, 11434, 32960, 94211, 267384, 754309, 2116936, 5914310, 16458034, 45638101, 126159156, 347769719, 956238170, 2623278946, 7181512964, 19622668679, 53522804976, 145753273225, 396323283724, 1076167858046, 2918447861686
Offset: 1

Views

Author

Keywords

Comments

Sum of pyramid weights of all nondecreasing Dyck paths of semilength n. (A pyramid in a Dyck word (path) is a factor of the form U^h D^h, where U=(1,1), D=(1,-1) and h is the height of the pyramid. A pyramid in a Dyck word w is maximal if, as a factor in w, it is not immediately preceded by a u and immediately followed by a d. The pyramid weight of a Dyck path (word) is the sum of the heights of its maximal pyramids.) Example: a(4) = 46. Indeed, there are 14 Dyck paths of semilength 4. One of them, namely UUDUDDUD is not nondecreasing because the valleys are at heights 1 and 0. The other 13, with the maximal pyramids shown between parentheses, are: (UD)(UD)(UD)(UD), (UD)(UD)(UUDD), (UD)(UUDD)(UD), (UD)U(UD)(UD)D, (UD)(UUUDDD), (UUDD)(UD)(UD), (UUDD)(UUDD), (UUUDDD)(UD), U(UD)(UD)(UD)D, U(UD)(UUDD)D, U(UUDD)(UD)D, UU(UD)(UD)DD and (UUUUDDDD). The pyramid weights of these paths are 4, 4, 4, 3, 4, 4, 4, 4, 3, 3, 3, 2, and 4, respectively. Their sum is 46. a(n) = Sum_{k = 1..n} k*A121462(n, k). - Emeric Deutsch, Jul 31 2006
Number of 1s in all compositions of n, where compositions are understood with two different kinds of 1s, say 1 and 1' (n >= 1). Example: a(2) = 4 because the compositions of 2 are 11, 11', 1'1, 1'1', 2, having a total of 2 + 1 + 1 + 0 + 0 = 4 1s. Also number of k's in all compositions of n + k (k = 2, 3, ...). - Emeric Deutsch, Jul 21 2008
From Petros Hadjicostas, Jun 24 2019: (Start)
If c = (c(m): m >= 1) is the input sequence and b_k = (b_k(n): n >= 1) is the output sequence under the AIK[k] = INVERT[k] transform (see Bower's web link below), then the bivariate g.f. of the list of sequences (b_k: k >= 1) = ((b_k(n): n >= 1): k >= 1) is Sum_{n, k >= 1} b_k(n)*x^n*y^k = y*C(x)/(1 - y*C(x)), where C(x) = Sum_{m >= 1} c(m)*x^m is the g.f. of the input sequence.
Here, b_k(n) is the number of all (linear) compositions of n with k parts where a part of size m is colored with one of c(m) colors. Thus, Sum_{k = 1..n} k*b_k(n) is the total number of parts in all compositions of n.
If we differentiate the bivariate g.f. function above, i.e., Sum_{n, k >= 1} b_k(n)*x^n*y^k, with respect to y and set y = 1, we get the g.f. of the sequence (Sum_{k = 1..n} k*b_k(n): n >= 1). It is C(x)/(1 - C(x))^2.
When c(m) = m for all m >= 1, we have m-color compositions of n that were first studied by Agarwal (2000). The cyclic version of these m-color compositions were studied by Gibson (2017) and Gibson et al. (2018).
When c(m) = m for each m >= 1, we have C(x) = x/(1 - x)^2, and so C(x)/(1 - C(x))^2 = x * (1 - x)^2/(1 - 3*x + x^2)^2, which is the g.f. of the current sequence.
Hence, a(n) is the total number of parts in all m-color compositions of n (in the sense of Agarwal (2000)).
(End)
Series reversal gives A153294 starting from index 1, with alternating signs: 1, -4, 18, -86, 427, -2180, ... - Vladimir Reshetnikov, Aug 03 2019

Examples

			From _Petros Hadjicostas_, Jun 24 2019: (Start)
Recall that with m-color compositions, a part of size m may be colored with one of m colors.
We have a(1) = 1 because we only have one colored composition, namely 1_1, that has only 1 part.
We have a(2) = 4 because we have the following colored compositions of n = 2: 2_1, 2_2, 1_1 + 1_1; hence, a(2) = 1 + 1 + 2 = 4.
We have a(3) = 14 because we have the following colored compositions of n = 3: 3_1, 3_2, 3_3, 1_1 + 2_1, 1_1 + 2_2, 2_1 + 1_1, 2_2 + 1_1, 1_1 + 1_1 + 1_1; hence, a(3) = 1 + 1 + 1 + 2 + 2 + 2 + 2 + 3 = 14.
We have a(14) = 46 because we have the following colored compositions of n = 4:
(i) 4_1, 4_2, 4_3, 4_4; with a total of 4 parts.
(ii) 1_1 + 3_1, 1_1 + 3_2, 1_1 + 3_3, 3_1 + 1_1, 3_2 + 1_1, 3_3 + 1_1, 2_1 + 2_1, 2_1 + 2_2, 2_2 + 2_1, 2_2 + 2_2; with a total of 2 x 10 = 20 parts.
(iii) 1_1 + 1_1 + 2_1, 1_1 + 1_1 + 2_2, 1_1 + 2_1 + 1_1, 1_1 + 2_2 + 1_1, 2_1 + 1_1 + 1_1, 2_2 + 1_1 + 1_1; with a total of 3 x 6 = 18 parts.
(iv) 1_1 + 1_1 + 1_1 + 1_1; with a total of 4 parts.
Hence, a(4) = 4 + 20 + 18 + 4 = 46.
(End)
		

References

  • R. P. Grimaldi, Compositions and the alternate Fibonacci numbers, Congressus Numerantium, 186, 2007, 81-96.

Crossrefs

Partial sums of A038731. First differences of A001870.
Cf. A001629 (right-shifted inverse Binomial Transform), A023610 (inverse Binomial Transform of left-shifted sequence), A030279, A045623, A088305, A121462, A153294, A279282, A307415, A308723.

Programs

  • Maple
    with(combinat): L[0]:=2: L[1]:=1: for n from 2 to 60 do L[n]:=L[n-1] +L[n-2] end do: seq(2*fibonacci(2*n)*1/5+(1/5)*n*L[2*n],n=1..30); # Emeric Deutsch, Jul 21 2008
  • Mathematica
    Table[Sum[k Binomial[n+k-1,2k-1],{k,n}],{n,30}] (* or *) LinearRecurrence[ {6,-11,6,-1},{1,4,14,46},30] (* Harvey P. Dale, Aug 01 2011 *)
  • PARI
    a(n)=(2*n*fibonacci(2*n+1)+(2-n)*fibonacci(2*n))/5

Formula

a(n) = -a(-n) = (2n * F(2n+1) + (2 - n) * F(2n))/5 with F(n) = A000045(n) (Fibonacci numbers).
G.f.: x * (1 - x)^2/(1 - 3*x + x^2)^2.
a(n) = Sum_{k = 1..n} k*C(n + k - 1, 2*k - 1).
a(n) = (2/5)*F(2*n) + (1/5)*n*L(2*n), where F(k) are the Fibonacci numbers (F(0)=0, F(1)=1) and L(k) are the Lucas numbers (L(0) = 2, L(1) = 1). - Emeric Deutsch, Jul 21 2008
a(0) = 1, a(1) = 4, a(2) = 14, a(3) = 46, a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3) - a(n-4). - Harvey P. Dale, Aug 01 2011
a(n) = ((3 - sqrt(5))^n*(5*n - 2*sqrt(5)) + (3 + sqrt(5))^n*(5*n + 2*sqrt(5)))/ (25*2^n). - Peter Luschny, Mar 07 2022
E.g.f.: exp(3*x/2)*(15*x*cosh(sqrt(5)*x/2) + sqrt(5)*(4 + 5*x)*sinh(sqrt(5)*x/2))/25. - Stefano Spezia, Mar 04 2025

Extensions

Name clarified using a comment of the author by Peter Luschny, Aug 03 2019

A034007 First differences of A045891.

Original entry on oeis.org

1, 0, 2, 4, 9, 20, 44, 96, 208, 448, 960, 2048, 4352, 9216, 19456, 40960, 86016, 180224, 376832, 786432, 1638400, 3407872, 7077888, 14680064, 30408704, 62914560, 130023424, 268435456, 553648128, 1140850688, 2348810240
Offset: 0

Views

Author

Keywords

Comments

Let M_n be the n X n matrix m_(i,j) = 4 + abs(i-j) then det(M_n) = (-1)^(n+1)*a(n+2). - Benoit Cloitre, May 28 2002
Number of ordered pairs of (possibly empty) ordered partitions, each not beginning with 1. - Christian G. Bower, Jan 23 2004
If X_1, X_2, ..., X_n are 2-blocks of a (2n+4)-set X then, for n>=1, a(n+3) is the number of (n+1)-subsets of X intersecting each X_i, (i=1,2,...,n). - Milan Janjic, Nov 18 2007
Except for an initial 1, this is the p-INVERT of (1,1,1,1,1,...) for p(S) = (1 - S^2)^2; see A291000. - Clark Kimberling, Aug 24 2017
Conjecture 1: For compositions of n+k-1, a(n) is the number of runs of 1 of length k. Example: Among the compositions of 4+2-1 = 5, there are a(4) = 4 runs of two 1's: 3,[1,1]; [1,1],3; 1,2,[1,1] and [1,1],2,1. - Gregory L. Simay, Feb 18 2018
Conjecture 2: More generally, let R(n,m,k) = the number of runs of k m's in all compositions of n. Then R(n,m,k) = A045623(n-m*k) - 2*A045623(n-m*(k+1)) + A045623(n-m*(k+2)). For example, R(7,1,1) = A045623(6) - 2*A045623(5) + A045623(4) = 144 - 2*64 + 28 = 44 = a(7). - Gregory L. Simay, Feb 20 2018

Crossrefs

Convolution of A034008 with itself.
Columns of A091613 converge to this sequence.

Programs

Formula

a(n) = Sum_{k = 0..n-3} (k+4)*binomial(n-3,k) for n >= 3. - N. J. A. Sloane, Jan 30 2008
a(n) = (n+5)*2^(n-4), n >= 3; a(0)=1, a(1)=0, a(2)=2.
G.f.: ((1-x)^2/(1-2*x))^2.
a(n) = Sum_{k=0..n} (k+1)*C(n-3,n-k). - Peter Luschny, Apr 20 2015
From Amiram Eldar, Jan 13 2021: (Start)
Sum_{n>=2} 1/a(n) = 512*log(2) - 74327/210.
Sum_{n>=2} (-1)^n/a(n) = 14579/70 - 512*log(3/2). (End)
E.g.f.: (1/16)*(11 - 12*x + 2*x^2 + (5+2*x)*exp(2*x)). - G. C. Greubel, Sep 27 2022

A062111 Upper-right triangle resulting from binomial transform calculation for nonnegative integers.

Original entry on oeis.org

0, 1, 1, 4, 3, 2, 12, 8, 5, 3, 32, 20, 12, 7, 4, 80, 48, 28, 16, 9, 5, 192, 112, 64, 36, 20, 11, 6, 448, 256, 144, 80, 44, 24, 13, 7, 1024, 576, 320, 176, 96, 52, 28, 15, 8, 2304, 1280, 704, 384, 208, 112, 60, 32, 17, 9, 5120, 2816, 1536, 832, 448, 240, 128, 68, 36, 19, 10
Offset: 0

Views

Author

Henry Bottomley, May 30 2001

Keywords

Comments

From Philippe Deléham, Apr 15 2007: (Start)
This triangle can be found in the Laisant reference in the following form:
.......................5...11..
...................4...9...20..
...............3...7..16...36..
...........2...5..12..28.......
.......1...3...8..20..48.......
...0...1...4..12..32..80....... (End)
Triangle A152920 reversed. - Philippe Deléham, Apr 21 2009

Examples

			As a lower triangle (T(n, k)):
    0;
    1,   1;
    4,   3,   2;
   12,   8,   5,  3;
   32,  20,  12,  7,  4;
   80,  48,  28, 16,  9,  5;
  192, 112,  64, 36, 20, 11,  6;
  448, 256, 144, 80, 44, 24, 13, 7;
		

Crossrefs

Rows include (essentially) A001787, A001792, A034007, A045623, A045891.
Diagonals include (essentially) A001477, A005408, A008586, A008598, A017113.
Column sums are A058877.

Programs

  • Magma
    [2^(n-k-1)*(n+k): k in [0..n], n in [0..12]]; // G. C. Greubel, Sep 28 2022
    
  • Mathematica
    Table[2^(n-k-1)*(n+k), {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Sep 28 2022 *)
  • SageMath
    def A062111(n,k): return 2^(n-k-1)*(n+k)
    flatten([[A062111(n,k) for k in range(n+1)] for n in range(12)]) # G. C. Greubel, Sep 28 2022

Formula

A(n, k) = A(n, k-1) + A(n+1, k) if k > n with A(n, n) = n.
A(n, k) = (k+n)*2^(k-n-1) if k >= n.
T(2*n, n) = 3*n*2^(n-1) = 3*A001787(n). - Philippe Deléham, Apr 21 2009
From G. C. Greubel, Sep 28 2022: (Start)
T(n, k) = 2^(n-k-1)*(n+k) for 0 <= k <= n, n >= 0.
T(m*n, n) = 2^((m-1)*n-1)*(m+1)*A001477(n), m >= 1.
T(2*n-1, n-1) = A130129(n-1).
T(2*n+1, n-1) = 12*A001787(n).
Sum_{k=0..n} T(n, k) = A058877(n+1).
Sum_{k=0..n} (-1)^k*T(n, k) = 3*A073371(n-2), n >= 2.
T(n, k) = A152920(n, n-k). (End)

A233940 Number T(n,k) of binary words of length n with exactly k (possibly overlapping) occurrences of the subword given by the binary expansion of n; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 2, 1, 12, 4, 21, 10, 1, 33, 30, 1, 81, 26, 13, 5, 2, 1, 177, 78, 1, 338, 156, 18, 667, 278, 68, 10, 1, 1178, 722, 142, 6, 2031, 1827, 237, 1, 4105, 3140, 862, 84, 1, 6872, 7800, 1672, 40, 20569, 5810, 3188, 1662, 829, 394, 181, 80, 35, 12, 5, 2, 1
Offset: 0

Views

Author

Alois P. Heinz, Dec 18 2013

Keywords

Comments

T(n,k) is defined for n,k >= 0. The triangle contains only the positive terms.

Examples

			T(3,0) = 5: 000, 001, 010, 100, 101 (subword 11 is avoided).
T(3,1) = 2: 011, 110 (exactly one occurrence of 11).
T(3,2) = 1: 111 (two overlapping occurrences of 11).
Triangle T(n,k) begins:
: n\k :   0    1   2   3  4  5 ...
+-----+------------------------
:  0  :   1;                       [row  0 of A007318]
:  1  :   1,   1;                  [row  1 of A007318]
:  2  :   3,   1;                  [row  2 of A034867]
:  3  :   5,   2,  1;              [row  3 of A076791]
:  4  :  12,   4;                  [row  4 of A118424]
:  5  :  21,  10,  1;              [row  5 of A118429]
:  6  :  33,  30,  1;              [row  6 of A118424]
:  7  :  81,  26, 13,  5, 2, 1;    [row  7 of A118390]
:  8  : 177,  78,  1;              [row  8 of A118884]
:  9  : 338, 156, 18;              [row  9 of A118890]
: 10  : 667, 278, 68, 10, 1;       [row 10 of A118869]
		

Crossrefs

Columns k=0-10 give: A234005 (or main diagonal of A209972), A229905, A236231, A236232, A236233, A236234, A236235, A236236, A236237, A236238, A236239.
T(2^n-1,2^n-2n+1) = A045623(n-1) for n>0.
Last elements of rows give A229293.
Row sums give A000079.

Programs

  • Maple
    F:= proc(n)
    local w, L, s,b,s0,R,j,T,p,y,m,ymax;
    w:= ListTools:-Reverse(convert(n,base,2));
    L:= nops(w);
    for s from 0 to L-1 do
      for b from 0 to 1 do
       s0:= [op(w[1..s]),b];
       if s0 = w then R[s,b]:= 1
       else R[s,b]:= 0
       fi;
       for j from min(nops(s0),L-1) by -1 to 0 do
          if s0[-j..-1] = w[1..j] then
            T[s,b]:= j;
            break
          fi
       od;
    od;
    od;
    for s from L-1 by -1 to 0 do
      p[0,s,n]:= 1:
      for y from 1 to n do
         p[y,s,n]:= 0 od od;
    for m from n-1 by -1 to 0 do
       for s from L-1 by -1 to 0 do
          for y from 0 to n do
            p[y,s,m]:= `if`(y>=R[s,0],1/2*p[y-R[s,0],T[s,0],m+1],0)
                      +
    `if`(y>=R[s,1],1/2*p[y-R[s,1],T[s,1],m+1],0)
    od od od:
    ymax:= ListTools:-Search(0,[seq(p[y,0,0],y=0..n)])-2;
    seq(2^n*p[y,0,0],y=0..ymax);
    end proc:
    F(0):= 1:
    F(1):= (1,1):
    for n from 0 to 30 do F(n) od; # Robert Israel, May 22 2015
  • Mathematica
    (* This program is not convenient for a large number of rows *) count[word_List, subword_List] := Module[{cnt = 0, s1 = Sequence @@ subword, s2 = Sequence @@ Rest[subword]}, word //. {a___, s1, b___} :> (cnt++; {a, 2, s2, b}); cnt]; t[n_, k_] := Module[{subword, words}, subword = IntegerDigits[n, 2]; words = PadLeft[IntegerDigits[#, 2], n] & /@ Range[0, 2^n - 1]; Select[words, count[#, subword] == k &] // Length]; row[n_] := Reap[For[k = 0, True, k++, tnk = t[n, k]; If[tnk == 0, Break[], Sow[tnk]]]][[2, 1]]; Table[Print["n = ", n, " ", r = row[n]]; r, {n, 0, 15}] // Flatten (* Jean-François Alcover, Feb 13 2014 *)

Formula

Sum_{k>0} k*T(n,k) = A228612(n).

A087447 a(0) = a(1) = 1; for n > 1, a(n) = (n+2)*2^(n-2).

Original entry on oeis.org

1, 1, 4, 10, 24, 56, 128, 288, 640, 1408, 3072, 6656, 14336, 30720, 65536, 139264, 294912, 622592, 1310720, 2752512, 5767168, 12058624, 25165824, 52428800, 109051904, 226492416, 469762048, 973078528, 2013265920, 4160749568
Offset: 0

Views

Author

Paul Barry, Sep 05 2003

Keywords

Comments

Binomial transform of A005408 (with interpolated zeros). Binomial transform is A087448. a(n+2) = 2*A045623(n+1); a(n+1) = A001792(n) + (0^n - (-2)^n)/2. The sequence 1,4,10,... given by 2^n*(n+3)/2 - 0^n/2 is the binomial transform of 1,3,3,5,5,...
Equals real part of binomial transform of [1, 2*i, 3, 4*i, 5, 6*i, ...]; i=sqrt(-1). - Gary W. Adamson, Sep 21 2008
An elephant sequence, see A175655. For the central square 24 A[5] vectors, with decimal values between 27 and 432, lead to this sequence (without the first leading 1). For the corner squares these vectors lead to the companion sequence A057711 (without the leading 0). - Johannes W. Meijer, Aug 15 2010

Crossrefs

Essentially same as A079859.

Programs

  • Mathematica
    Join[{1, 1}, Table[(n + 2) 2^(n - 2), {n, 2, 30}]]  (* Harvey P. Dale, Feb 22 2011 *)
  • Python
    def A087447(n): return n+2<1 else 1 # Chai Wah Wu, Oct 03 2024

Formula

a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)*(2k+1). - Paul Barry, Nov 29 2004
From Colin Barker, Mar 23 2012: (Start)
G.f.: (1-x)*(1-2*x+2*x^2)/(1-2*x)^2.
a(n) = 4*a(n-1) - 4*a(n-2) for n > 3. (End)
E.g.f.: (1 - x + exp(2*x)*(1 + x))/2. - Stefano Spezia, Jan 31 2023

Extensions

Definition corrected (by a factor of 2) by R. J. Mathar, Feb 21 2009

A103450 A figurate number triangle read by rows.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 5, 1, 1, 7, 12, 7, 1, 1, 9, 22, 22, 9, 1, 1, 11, 35, 50, 35, 11, 1, 1, 13, 51, 95, 95, 51, 13, 1, 1, 15, 70, 161, 210, 161, 70, 15, 1, 1, 17, 92, 252, 406, 406, 252, 92, 17, 1, 1, 19, 117, 372, 714, 882, 714, 372, 117, 19, 1, 1, 21, 145, 525, 1170, 1722, 1722, 1170, 525, 145, 21, 1
Offset: 0

Views

Author

Paul Barry, Feb 06 2005

Keywords

Comments

Row coefficients are the absolute values of the coefficients of the characteristic polynomials of the n X n matrices A(n) with A(n){i,i} = 2, i>0, A(n){i,j} = 1, otherwise (starts with (0,0) position).
The triangle can be generated by the matrix multiplication A007318 * A114219s, where A114219s = 0; 0,1; 0,1,1; 0,-1,2,1; 0,1,-2,3,1; 0,-1,2,-3,4,1; ... = A097807 * A128229 is a signed variant of A114219. - Gary W. Adamson, Feb 20 2007

Examples

			From _Roger L. Bagula_, Oct 21 2008: (Start)
The triangle begins:
  1;
  1,  1;
  1,  3,   1;
  1,  5,   5,   1;
  1,  7,  12,   7,   1;
  1,  9,  22,  22,   9,   1;
  1, 11,  35,  50,  35,  11,   1;
  1, 13,  51,  95,  95,  51,  13,   1;
  1, 15,  70, 161, 210, 161,  70,  15,   1;
  1, 17,  92, 252, 406, 406, 252,  92,  17,  1;
  1, 19, 117, 372, 714, 882, 714, 372, 117, 19, 1; ... (End)
		

Crossrefs

Row sums are A045623.
Columns include: A000326, A002412, A002418, A005408.

Programs

  • Magma
    A103450:= func< n,k | k eq 0 select 1 else Binomial(n, k)*(k*(n-k) + n)/n >;
    [A103450(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 17 2021
    
  • Mathematica
    (* First program *)
    p[x_, n_]:= p[x, n]= If[n==0, 1, (-1+x)^(n-2)*(1 -(n+1)*x +x^2)];
    T[n_, k_]:= T[n,k]= (-1)^(n+k)*SeriesCoefficient[p[x, n], {x, 0, k}];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* Roger L. Bagula and Gary W. Adamson, Oct 21 2008 *)(* corrected by G. C. Greubel, Jun 17 2021 *)
    (* Second program *)
    T[n_, k_]:= If[k==0, 1, Binomial[n, k]*(n*(k+1) -k^2)/n];
    Table[T[n, k], {n,0,16}, {k,0,n}]//Flatten (* G. C. Greubel, Jun 17 2021 *)
  • Sage
    def A103450(n, k): return 1 if (k==0) else binomial(n, k)*(k*(n-k) + n)/n
    flatten([[A103450(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jun 17 2021

Formula

T(n, k) = binomial(n-1, k-1)*(k*(n-k) + n)/k with T(n, 0) = 1.
T(n, k) = T(n-1, k-1) + T(n-1, k) + binomial(n-2, k-1) with T(n, 0) = 1.
Column k is generated by (1+k*x)*x^k/(1-x)^(k+1).
Rows are coefficients of the polynomials P(0, x) = 1, P(n, x) = (1+x)^(n-2)*(1 +(n+1)*x + x^2) for n>0.
T(n,k) = Sum_{j=0..n} binomial(k, k-j)*binomial(n-k, j)*(j+1). - Paul Barry, Oct 28 2006
A signed version arises from the coefficients of the polynomials defined by: p(x, 0) = 1, p(x, 1) = (-1 +x), p(x, 2) = (1 -3*x +x^2), p(x,n) = (-1 +x)^(n-2)*(1 - (n + 1)*x + x^2); T(n, k) = (-1)^(n+k)*coefficient of x^k of ( p(x,n) ). - Roger L. Bagula and Gary W. Adamson, Oct 21 2008
T(2*n+1, n) = A141222(n). - Emanuele Munarini, Jun 01 2012 [corrected by Werner Schulte, Nov 27 2021]
G.f.: is 1 / ( (1-q*x/(1-x)) * (1-x/(1-q*x)) ). - Joerg Arndt, Aug 27 2013
Sum_{k=0..floor(n/2)} T(n-k, k) = (1/5)*((-n+5)*Fibonacci(n+1) + (3*n- 2)*Fibonacci(n)) = A208354(n). - G. C. Greubel, Jun 17 2021
T(2*n, n) = A000984(n) * (n + 2) / 2 for n >= 0. - Werner Schulte, Nov 27 2021

A152920 Triangle read by rows: triangle A062111 reversed.

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 3, 5, 8, 12, 4, 7, 12, 20, 32, 5, 9, 16, 28, 48, 80, 6, 11, 20, 36, 64, 112, 192, 7, 13, 24, 44, 80, 144, 256, 448, 8, 15, 28, 52, 96, 176, 320, 576, 1024, 9, 17, 32, 60, 112, 208, 384, 704, 1280, 2304, 10, 19, 36, 68, 128, 240, 448, 832, 1536, 2816, 5120
Offset: 0

Views

Author

Paul Curtz, Dec 15 2008

Keywords

Examples

			Triangle starts:
  0;
  1,  1;
  2,  3,  4;
  3,  5,  8, 12;
  4,  7, 12, 20, 32;
  ...
		

Crossrefs

Programs

  • Magma
    [2^k*(n-k/2): k in [0..n], n in [0..12]]; // G. C. Greubel, Sep 27 2022
    
  • Maple
    A062111 := proc(n,k) (k+n)*2^(k-n-1) ; end: A152920 := proc(n,k) A062111(n-k,n) ; end: for n from 0 to 15 do for k from 0 to n do printf("%d,",A152920(n,k)) ; od: od: # R. J. Mathar, Jan 22 2009
    # second Maple program:
    T:= proc(n, k) option remember;
         `if`(k=0, n, T(n, k-1)+T(n-1, k-1))
        end:
    seq(seq(T(n, k), k=0..n), n=0..12);  # Alois P. Heinz, Sep 12 2022
  • Mathematica
    t[0, k_]:= k; t[n_, k_]:= t[n, k]= t[n-1, k] + t[n-1, k+1];
    Table[t[n-k, k], {n,0,10}, {k,n,0,-1}]//Flatten (* Jean-François Alcover, Sep 11 2016 *)
  • SageMath
    flatten([[2^(k-1)*(2*n-k) for k in range(n+1)] for n in range(12)]) # G. C. Greubel, Sep 27 2022

Formula

Row sums: (2^n-1)(n+1) = A058877(n). - R. J. Mathar, Jan 22 2009
T(2n, n) = 3*n*2^(n-1) = 3*A001787(n). - Philippe Deléham, Apr 20 2009
From Werner Schulte, Jul 31 2020: (Start)
T(n, k) = (2*n-k) * 2^(k-1) for 0 <= k <= n.
G.f.: Sum_{n>=0, k=0..n} T(n,k) * x^k * t^n = t*(1+x-3*x*t) / ((1-t)^2 * (1-2*x*t)^2).
Sum_{k=0..n} (-1)^k * binomial(n,k) * T(n,k) = 0 for n >= 0.
Sum_{k=0..n} binomial(n,k) * T(n,k) = 2*n * 3^(n-1) for n >= 0.
Define the array B(n,p) = (Sum_{k=0..n} binomial(p+k,p) * T(n,k))/(n+p+1) for n >= 0 and p >= 0. Then see the comment of Robert Coquereaux (2014) at A193844. Conjecture: B(n+1,p) = A(n,p). (End)
T(n, k) = T(n, k-1) + T(n-1, k-1) for k>=1, T(n,0) = n. - Alois P. Heinz, Sep 12 2022
From G. C. Greubel, Sep 27 2022: (Start)
T(n, n-1) = A001792(n).
T(2*n-1, n-1) = A053220(n).
T(2*n+1, n-1) = 3*A001792(n).
T(m*n, n) = (2*m-1)*A001787(n), for m >= 1. (End)

Extensions

Edited by N. J. A. Sloane, Dec 19 2008
More terms from R. J. Mathar, Jan 22 2009
Previous Showing 11-20 of 85 results. Next