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

A072547 Main diagonal of the array in which first column and row are filled alternatively with 1's or 0's and then T(i,j) = T(i-1,j) + T(i,j-1).

Original entry on oeis.org

1, 0, 2, 6, 22, 80, 296, 1106, 4166, 15792, 60172, 230252, 884236, 3406104, 13154948, 50922986, 197519942, 767502944, 2987013068, 11641557716, 45429853652, 177490745984, 694175171648, 2717578296116, 10648297329692, 41757352712480
Offset: 1

Views

Author

Benoit Cloitre, Aug 05 2002

Keywords

Comments

A Catalan transform of A078008 under the mapping g(x)->g(xc(x)). - Paul Barry, Nov 13 2004
Number of positive terms in expansion of (x_1 + x_2 + ... + x_{n-1} - x_n)^n. - Sergio Falcon, Feb 08 2007
Hankel transform is A088138(n+1). - Paul Barry, Feb 17 2009
Without the beginning "1", we obtain the first diagonal over the principal diagonal of the array notified by B. Cloitre in A026641 and used by R. Choulet in A172025, and from A172061 to A172066. - Richard Choulet, Jan 25 2010
Also central terms of triangles A108561 and A112465. - Reinhard Zumkeller, Jan 03 2014
With offset 0 and for p prime, the p-th term is divisible by p. - F. Chapoton, Dec 03 2021

Examples

			The array begins:
  1 0 1 0 1..
  0 0 1 1 2..
  1 1 2 3 5..
  0 1 3 6 11..
so sequence begins : 1, 0, 2, 6, ...
		

References

  • L. W. Shapiro and C. J. Wang, Generating identities via 2 X 2 matrices, Congressus Numerantium, 205 (2010), 33-46.

Crossrefs

Programs

  • Haskell
    a072547 n = a108561 (2 * (n - 1)) (n - 1)
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Magma
    R:=PowerSeriesRing(Rationals(), 30); Coefficients(R!( x*(1 + Sqrt(1-4*x))/(Sqrt(1-4*x)*(3-Sqrt(1-4*x))) )); // G. C. Greubel, Feb 17 2019
    
  • Maple
    taylor( (2/(3*sqrt(1-4*z)-1+4*z))*((1-sqrt(1-4*z))/(2*z))^(-1),z=0,42); for n from -1 to 40 do a(n):=sum('(-1)^(p)*binomial(2n-p+1,1+n-p)',p=0..n+1): od:seq(a(n),n=-1..40):od; # Richard Choulet, Jan 25 2010
  • Mathematica
    CoefficientList[Series[(2/(3*Sqrt[1-4*x]-1+4*x))*((1-Sqrt[1-4*x]) /(2*x))^(-1), {x, 0, 20}], x] (* Vaclav Kotesovec, Feb 13 2014 *)
    a[n_] := Binomial[2 n - 2, n] Hypergeometric2F1[1, 2 - n, n + 1, 1/2] / 2 + (-2)^(1 - n); Table[a[n], {n, 1, 26}] (* Peter Luschny, Dec 03 2021 *)
  • PARI
    a(n) = (-1)^n*sum(k=0, n, binomial(-n, k));
    vector(100, n, a(n-1)) \\ Altug Alkan, Oct 02 2015
    
  • Sage
    a=(x*(1+sqrt(1-4*x))/(sqrt(1-4*x)*(3-sqrt(1-4*x)))).series(x, 30).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 17 2019

Formula

If offset is 0, a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n+k-1, k). - Vladeta Jovovic, Feb 18 2003
G.f.: x*(1-x*C)/(1-2*x*C)/(1+x*C), where C = (1-sqrt(1-4*x))/(2*x) is g.f. for Catalan numbers (A000108). - Vladeta Jovovic, Feb 18 2003
a(n) = Sum_{j=0..floor((n-1)/2)} binomial(2*n-2*j-4, n-3). - Emeric Deutsch, Jan 28 2004
a(n) = A108561(2*(n-1),n-1). - Reinhard Zumkeller, Jun 10 2005
a(n) = (-1)^n*Sum_{k=0..n} binomial(-n,k) (offset 0). - Paul Barry, Feb 17 2009
Other form of the G.f: f(z) = (2/(3*sqrt(1-4*z) -1 +4*z))*((1 -sqrt(1-4*z))/(2*z))^(-1). - Richard Choulet, Jan 25 2010
D-finite with recurrence 2*(-n+1)*a(n) + (9*n-17)*a(n-1) + (-3*n+19)*a(n-2) + 2*(-2*n+7)*a(n-3) = 0. - R. J. Mathar, Nov 30 2012
From Peter Bala, Oct 01 2015: (Start)
a(n) = [x^n] ((1 - x)^2/(1 - 2*x))^n.
Exp( Sum_{n >= 1} a(n+1)*x^n/n ) = 1 + x^2 + 2*x^3 + 6*x^4 + 18*x^5 + ... is the o.g.f for A000957. (End)
a(n) = binomial(2*n-2, n)*hypergeom([1, 2-n], [n+1], 1/2) / 2 + (-2)^(1-n). - Peter Luschny, Dec 03 2021
a(n) = 2 * A014301(n-1) for n>=3. - Alois P. Heinz, Dec 27 2023

Extensions

Corrected and extended by Vladeta Jovovic, Feb 17 2003

A059259 Triangle read by rows giving coefficient T(i,j) of x^i y^j in 1/(1-x-x*y-y^2) = 1/((1+y)(1-x-y)) for (i,j) = (0,0), (1,0), (0,1), (2,0), (1,1), (0,2), ...

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 2, 0, 1, 3, 4, 2, 1, 1, 4, 7, 6, 3, 0, 1, 5, 11, 13, 9, 3, 1, 1, 6, 16, 24, 22, 12, 4, 0, 1, 7, 22, 40, 46, 34, 16, 4, 1, 1, 8, 29, 62, 86, 80, 50, 20, 5, 0, 1, 9, 37, 91, 148, 166, 130, 70, 25, 5, 1, 1, 10, 46, 128, 239, 314, 296, 200
Offset: 0

Views

Author

N. J. A. Sloane, Jan 23 2001

Keywords

Comments

This sequence provides the general solution to the recurrence a(n) = a(n-1) + k*(k+1)*a(n-2), a(0)=a(1)=1. The solution is (1, 1, k^2 + k + 1, 2*k^2 + 2*k + 1, ...) whose coefficients can be read from the rows of the triangle. The row sums of the triangle are given by the case k=1. These are the Jacobsthal numbers, A001045. Viewed as a square array, its first row is (1,0,1,0,1,...) with e.g.f. cosh(x), g.f. 1/(1-x^2) and subsequent rows are successive partial sums given by 1/((1-x)^n * (1-x^2)). - Paul Barry, Mar 17 2003
Conjecture: every second column of this triangle is identical to a column in the square array A071921. For example, column 4 of A059259 (1, 3, 9, 22, 46, ...) appears to be the same as column 3 of A071921; column 6 of A059259 (1, 4, 16, 50, 130, 296, ...) appears to be the same as column 4 of A071921; and in general column 2k of A059259 appears to be the same as column k+1 of A071921. Furthermore, since A225010 is a transposition of A071921 (ignoring the latter's top row and two leftmost columns), there appears to be a correspondence between column 2k of A059259 and row k of A225010. - Mathew Englander, May 17 2014
T(n,k) is the number of n-tilings of a (one-dimensional) board that use k (1,1)-fence tiles and n-k squares. A (1,1)-fence is a tile composed of two pieces of width 1 separated by a gap of width 1. - Michael A. Allen, Jun 25 2020
See the Edwards-Allen 2020 paper, page 14, for proof of Englander's conjecture. - Michael De Vlieger, Dec 10 2020

Examples

			Triangle begins:
  1;
  1,  0;
  1,  1,  1;
  1,  2,  2,   0;
  1,  3,  4,   2,   1;
  1,  4,  7,   6,   3,   0;
  1,  5, 11,  13,   9,   3,   1;
  1,  6, 16,  24,  22,  12,   4,   0;
  1,  7, 22,  40,  46,  34,  16,   4,  1;
  1,  8, 29,  62,  86,  80,  50,  20,  5,  0;
  1,  9, 37,  91, 148, 166, 130,  70, 25,  5, 1;
  1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6, 0;
...
		

Crossrefs

See A059260 for an explicit formula.
Diagonals of this triangle are given by A006498.
Similar to the triangles A035317, A080242, A108561, A112555.

Programs

  • Maple
    read transforms; 1/(1-x-x*y-y^2); SERIES2(%,x,y,12); SERIES2TOLIST(%,x,y,12);
  • Mathematica
    T[n_, 0]:= 1; T[n_, n_]:= (1+(-1)^n)/2; T[n_, k_]:= T[n, k] = T[n-1, k] + T[n-1, k-1]; Table[T[n, k], {n, 0, 10} , {k, 0, n}]//Flatten (* G. C. Greubel, Jan 03 2017 *)
  • PARI
    {T(n,k) = if(k==0, 1, if(k==n, (1+(-1)^n)/2, T(n-1,k) +T(n-1,k-1)) )};
    for(n=0,10, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Apr 29 2019
  • Sage
    def A059259_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return (-1)^n
            if k==0: return 0
            return prec(n-1,k-1)-sum(prec(n,k+i-1) for i in (2..n-k+1))
        return [(-1)^(n-k+1)*prec(n+1, k) for k in (1..n)]
    for n in (1..12): print(A059259_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

G.f.: 1/(1 - x - x*y - y^2).
As a square array read by antidiagonals, this is T(n, k) = Sum_{i=0..n} (-1)^(n-i)*C(i+k, k). - Paul Barry, Jul 01 2003
T(2*n,n) = A026641(n). - Philippe Deléham, Mar 08 2007
T(n,k) = T(n-1,k) + T(n-2,k-1) + T(n-2,k-2), T(0,0) = T(1,0) = T(2,0) = T(2,1) = T(2,2)=1, T(1,1)=0, T(n,k)=0 if k < 0 or if k > n. - Philippe Deléham, Nov 24 2013
T(n,0) = 1, T(n,n) = (1+(-1)^n)/2, and T(n,k) = T(n-1,k) + T(n-1,k-1) for 0 < k < n. - Mathew Englander, May 24 2014
From Michael A. Allen, Jun 25 2020: (Start)
T(n,k) + T(n-1,k-1) = binomial(n,k) if n >= k > 0.
T(2*n-1,2*n-2) = T(2*n,2*n-1) = n, T(2*n,2*n-2) = n^2, T(2*n+1,2*n-1) = n*(n+1) for n > 0.
T(n,2) = binomial(n-2,2) + n - 1 for n > 1 and T(n,3) = binomial(n-3,3) + 2*binomial(n-2,2) for n > 2.
T(2*n-k,k) = A123521(n,k). (End)

A035317 Pascal-like triangle associated with A000670.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 4, 2, 1, 4, 7, 6, 3, 1, 5, 11, 13, 9, 3, 1, 6, 16, 24, 22, 12, 4, 1, 7, 22, 40, 46, 34, 16, 4, 1, 8, 29, 62, 86, 80, 50, 20, 5, 1, 9, 37, 91, 148, 166, 130, 70, 25, 5, 1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6, 1, 11, 56, 174, 367, 553, 610, 496, 295, 125
Offset: 0

Views

Author

Keywords

Comments

From Johannes W. Meijer, Jul 20 2011: (Start)
The triangle sums, see A180662 for their definitions, link this "Races with Ties" triangle with several sequences, see the crossrefs. Observe that the Kn4 sums lead to the golden rectangle numbers A001654 and that the Fi1 and Fi2 sums lead to the Jacobsthal sequence A001045.
The series expansion of G(x, y) = 1/((y*x-1)*(y*x+1)*((y+1)*x-1)) as function of x leads to this sequence, see the second Maple program. (End)
T(2n,k) = the number of hatted frog arrangements with k frogs on the 2xn grid. See the linked paper "Frogs, hats and common subsequences". - Chris Cox, Apr 12 2024

Examples

			Triangle begins:
  1;
  1,  1;
  1,  2,  2;
  1,  3,  4,   2;
  1,  4,  7,   6,   3;
  1,  5, 11,  13,   9,   3;
  1,  6, 16,  24,  22,  12,   4;
  1,  7, 22,  40,  46,  34,  16,   4;
  1,  8, 29,  62,  86,  80,  50,  20,  5;
  1,  9, 37,  91, 148, 166, 130,  70, 25,  5;
  1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6;
  ...
		

Crossrefs

Row sums are A000975, diagonal sums are A080239.
Central terms are A014300.
Similar to the triangles A059259, A080242, A108561, A112555.
Cf. A059260.
Triangle sums (see the comments): A000975 (Row1), A059841 (Row2), A080239 (Kn11), A052952 (Kn21), A129696 (Kn22), A001906 (Kn3), A001654 (Kn4), A001045 (Fi1, Fi2), A023435 (Ca2), Gi2 (A193146), A190525 (Ze2), A193147 (Ze3), A181532 (Ze4). - Johannes W. Meijer, Jul 20 2011
Cf. A181971.

Programs

  • Haskell
    a035317 n k = a035317_tabl !! n !! k
    a035317_row n = a035317_tabl !! n
    a035317_tabl = map snd $ iterate f (0, [1]) where
       f (i, row) = (1 - i, zipWith (+) ([0] ++ row) (row ++ [i]))
    -- Reinhard Zumkeller, Jul 09 2012
    
  • Maple
    A035317 := proc(n,k): add((-1)^(i+k) * binomial(i+n-k+1, i), i=0..k) end: seq(seq(A035317(n,k), k=0..n), n=0..10); # Johannes W. Meijer, Jul 20 2011
    A035317 := proc(n,k): coeff(coeftayl(1/((y*x-1)*(y*x+1)*((y+1)*x-1)), x=0, n), y, k) end: seq(seq(A035317(n,k), k=0..n), n=0..10); # Johannes W. Meijer, Jul 20 2011
  • Mathematica
    t[n_, k_] := (-1)^k*(((-1)^k*(n+2)!*Hypergeometric2F1[1, n+3, k+2, -1])/((k+1)!*(n-k+1)!) + 2^(k-n-2)); Flatten[ Table[ t[n, k], {n, 0, 11}, {k, 0, n}]] (* Jean-François Alcover, Dec 14 2011, after Johannes W. Meijer *)
  • PARI
    {T(n,k)=if(n==k,(n+2)\2,if(k==0,1,if(n>k,T(n-1,k-1)+T(n-1,k))))}
    for(n=0,12,for(k=0,n,print1(T(n,k),","));print("")) \\ Paul D. Hanna, Jul 18 2012
    
  • Sage
    def A035317_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return -prec(n-1,k-1)-sum(prec(n,k+i-1) for i in (2..n-k+1))
        return [(-1)^k*prec(n+2, k) for k in (1..n)]
    for n in (1..11): print(A035317_row(n)) # Peter Luschny, Mar 16 2016

Formula

T(n,k) = Sum_{j=0..floor(n/2)} binomial(n-2j, k-2j). - Paul Barry, Feb 11 2003
From Johannes W. Meijer, Jul 20 2011: (Start)
T(n, k) = Sum_{i=0..k}((-1)^(i+k) * binomial(i+n-k+1,i)). (Mendelson)
T(n, k) = T(n-1, k-1) + T(n-1, k) with T(n, 0) = 1 and T(n, n) = floor(n/2) + 1. (Mendelson)
Sum_{k = 0..n}((-1)^k * (n-k+1)^n * T(n, k)) = A000670(n). (Mendelson)
T(n, n-k) = A128176(n, k); T(n+k, n-k) = A158909(n, k); T(2*n-k, k) = A092879(n, k). (End)
T(2*n+1,n) = A014301(n+1); T(2*n+1,n+1) = A026641(n+1). - Reinhard Zumkeller, Jul 19 2012

Extensions

More terms from James Sellers

A001753 Expansion of 1/((1+x)*(1-x)^6).

Original entry on oeis.org

1, 5, 16, 40, 86, 166, 296, 496, 791, 1211, 1792, 2576, 3612, 4956, 6672, 8832, 11517, 14817, 18832, 23672, 29458, 36322, 44408, 53872, 64883, 77623, 92288, 109088, 128248, 150008, 174624, 202368, 233529
Offset: 0

Views

Author

Keywords

Comments

Number of symmetric nonnegative integer 5 X 5 matrices with sum of elements equal to 4*n under action of dihedral group D_4.
a(n) = A108561(n+6,n) for n>0. - Reinhard Zumkeller, Jun 10 2005

Examples

			There are 5 symmetric nonnegative integer 5 X 5 matrices with sum of elements equal to 4 under action of D_4:
[1 0 0 0 1] [0 0 1 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0]
[0 0 0 0 0] [0 0 0 0 0] [0 1 0 1 0] [0 0 1 0 0] [0 0 0 0 0]
[0 0 0 0 0] [1 0 0 0 1] [0 0 0 0 0] [0 1 0 1 0] [0 0 4 0 0]
[0 0 0 0 0] [0 0 0 0 0] [0 1 0 1 0] [0 0 1 0 0] [0 0 0 0 0]
[1 0 0 0 1] [0 0 1 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0].
		

Crossrefs

Cf. A000217, A002620, A008804, A038163, A054343, A001769 (partial sums), A001752 (first differences), A169793 (binomial transf).

Programs

  • Magma
    [(4*n^5+70*n^4+460*n^3+1400*n^2+1936*n+945)/960+(-1)^n/64: n in [0..40]]; // Vincenzo Librandi, Aug 15 2011
    
  • Mathematica
    CoefficientList[Series[1/((1+x)*(1-x)^6), {x, 0, 50}], x] (* G. C. Greubel, Nov 22 2017 *)
    LinearRecurrence[{5,-9,5,5,-9,5,-1},{1,5,16,40,86,166,296},40] (* Harvey P. Dale, Jun 05 2021 *)
  • PARI
    a(n)=(4*n^5+70*n^4+460*n^3+1400*n^2+1936*n)\/960+1 \\ Charles R Greathouse IV, Apr 17 2012

Formula

a(n) = Sum{k=0..n} (-1)^(n-k)*binomial(k+5, 5); a(n) = (4*n^5 + 70*n^4 + 460*n^3 + 1400*n^2 + 1936*n + 945)/960 + (-1)^n/64. - Paul Barry, Jul 01 2003
a(n) = a(n-2) + (n*(n + 1)*(n + 2)*(n - 1))/24, a(1) = 0, a(2) = 1; (15*(-1)^n - 15*(-1)^(2*n) + 96*n - 160*(-1)^(2*n)*n + 200*n^2 - 200*(-1)^(2*n)*n^2 + 140*n^3 - 80*(-1)^(2*n)*n^3 + 40*n^4 - 10*(-1)^(2*n)*n^4 + 4*n^5)/960. - Cecilia Rossiter (cecilia(AT)noticingnumbers.net), Dec 14 2004
a(n) + a(n+1) = A000389(n+6). - R. J. Mathar, Mar 14 2011

Extensions

Comment and example from Vladeta Jovovic, May 14 2000

A003600 Maximal number of pieces obtained by slicing a torus (or a bagel) with n cuts: (n^3 + 3*n^2 + 8*n)/6 (n > 0).

Original entry on oeis.org

1, 2, 6, 13, 24, 40, 62, 91, 128, 174, 230, 297, 376, 468, 574, 695, 832, 986, 1158, 1349, 1560, 1792, 2046, 2323, 2624, 2950, 3302, 3681, 4088, 4524, 4990, 5487, 6016, 6578, 7174, 7805, 8472, 9176, 9918, 10699, 11520, 12382, 13286, 14233, 15224
Offset: 0

Views

Author

Keywords

Comments

Both the bagel and the torus are solid (apart from the hole in the middle, of course)! - N. J. A. Sloane, Oct 03 2012

References

  • M. Gardner, The 2nd Scientific American Book of Mathematical Puzzles and Diversions. Simon and Schuster, NY, 1961. See Chapter 13. (See pages 113-116 in the English edition published by Pelican Books in 1966.)
  • Clifford A. Pickover, Computers and the Imagination, St. Martin's Press, NY, 1991, pp. 373-374 and Plate 27.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000124 (slicing a pancake), A000125 (a cake).
Cf. A004148.

Programs

  • Magma
    I:=[1, 2, 6, 13, 24]; [n le 5 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..50]]; // Vincenzo Librandi, Jun 29 2012
    
  • Mathematica
    CoefficientList[Series[(1-2*x+4*x^2-3*x^3+x^4)/(1-x)^4,{x,0,40}],x] (* Vincenzo Librandi, Jun 29 2012 *)
    LinearRecurrence[{4,-6,4,-1},{1,2,6,13,24},50] (* Harvey P. Dale, Oct 22 2016 *)
  • PARI
    a(n)=if(n,n*(n^2+3*n+8)/6,1) \\ Charles R Greathouse IV, Oct 07 2015

Formula

a(n) = binomial(n+2, n-1) + binomial(n, n-1).
a(n) = coefficient of z^3 in the series expansion of G^n (n>0), where G=[1-z+z^2-sqrt(1-2z-z^2-2z^3+z^4)]/(2z^2) is the g.f. of A004148 (secondary structures of RNA molecules). - Emeric Deutsch, Jan 11 2004
Binomial transform of [1, 1, 3, 0, 1, -1, 1, -1, 1, ...]. - Gary W. Adamson, Nov 08 2007
G.f.: (1 - 2*x + 4*x^2 - 3*x^3 + x^4) / (1 - x)^4. - Colin Barker, Jun 28 2012
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Vincenzo Librandi, Jun 29 2012
a(n) = A108561(n+4,3) for n > 0. - Reinhard Zumkeller, Jun 10 2005
a(n) = A000292(n+1) - A000124(n) for n > 0. - Torlach Rush, Aug 04 2018
a(n) = A000125(n+1) - 2, as one can see by thinking of the donut hole as a slit in a cake, i.e. an (n+1)st cut in the cake that doesn't quite reach the edges of the cake and so leaves two pieces unseparated. - Glen Whitney, Mar 31 2019
E.g.f.: 1 + exp(x)*x*(12 + 6*x + x^2)/6. - Stefano Spezia, Apr 19 2025

Extensions

More terms from James Sellers, Aug 22 2000

A112465 Riordan array (1/(1+x), x/(1-x)).

Original entry on oeis.org

1, -1, 1, 1, 0, 1, -1, 1, 1, 1, 1, 0, 2, 2, 1, -1, 1, 2, 4, 3, 1, 1, 0, 3, 6, 7, 4, 1, -1, 1, 3, 9, 13, 11, 5, 1, 1, 0, 4, 12, 22, 24, 16, 6, 1, -1, 1, 4, 16, 34, 46, 40, 22, 7, 1, 1, 0, 5, 20, 50, 80, 86, 62, 29, 8, 1, -1, 1, 5, 25, 70, 130, 166, 148, 91, 37, 9, 1, 1, 0, 6, 30, 95, 200, 296, 314, 239, 128, 46, 10, 1
Offset: 0

Views

Author

Paul Barry, Sep 06 2005

Keywords

Comments

Inverse is A112466. Note that C(n,k) = Sum_{j = 0..n-k} C(j+k-1, j).

Examples

			Triangle starts
   1;
  -1, 1;
   1, 0, 1;
  -1, 1, 1,  1;
   1, 0, 2,  2,  1;
  -1, 1, 2,  4,  3,  1;
   1, 0, 3,  6,  7,  4,  1;
  -1, 1, 3,  9, 13, 11,  5, 1;
   1, 0, 4, 12, 22, 24, 16, 6, 1;
Production matrix begins
  -1, 1;
   0, 1, 1;
   0, 0, 1, 1;
   0, 0, 0, 1, 1;
   0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 0, 0, 1, 1; - _Paul Barry_, Apr 08 2011
		

Crossrefs

Columns: A033999(n) (k=0), A000035(n) (k=1), A004526(n) (k=2), A002620(n-1) (k=3), A002623(n-4) (k=4), A001752(n-5) (k=5), A001753(n-6) (k=6), A001769(n-7) (k=7), A001779(n-8) (k=8), A001780(n-9) (k=9), A001781(n-10) (k=10), A001786(n-11) (k=11), A001808(n-12) (k=12).
Diagonals: A000012(n) (k=n), A023443(n) (k=n-1), A152947(n-1) (k=n-2), A283551(n-3) (k=n-3).
Main diagonal: A072547.
Sums: A078008 (row), A078024 (diagonal), A092220 (signed diagonal), A280560 (signed row).

Programs

  • Haskell
    a112465 n k = a112465_tabl !! n !! k
    a112465_row n = a112465_tabl !! n
    a112465_tabl = iterate f [1] where
       f xs'@(x:xs) = zipWith (+) ([-x] ++ xs ++ [0]) ([0] ++ xs')
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Magma
    A112465:= func< n,k | (-1)^(n+k)*(&+[(-1)^j*Binomial(j+k-1,j): j in [0..n-k]]) >;
    [A112465(n,k): k in [0..n], n in [0..13]]; // G. C. Greubel, Apr 18 2025
    
  • Mathematica
    T[n_, k_]:= Sum[Binomial[j+k-1, j]*(-1)^(n-k-j), {j, 0, n-k}];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* Jean-François Alcover, Jul 23 2018 *)
  • SageMath
    def A112465(n,k): return (-1)^(n+k)*sum((-1)^j*binomial(j+k-1,j) for j in range(n-k+1))
    print(flatten([[A112465(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Apr 18 2025

Formula

Number triangle T(n, k) = Sum_{j=0..n-k} (-1)^(n-k-j)*C(j+k-1, j).
T(2*n, n) = A072547(n) (main diagonal). - Paul Barry, Apr 08 2011
From Reinhard Zumkeller, Jan 03 2014: (Start)
T(n, k) = T(n-1, k-1) + T(n-1, k), 0 < k < n, with T(n, 0) = (-1)^n and T(n, n) = 1.
T(n, k) = A108561(n, n-k). (End)
T(n, k) = T(n-1, k-1) + T(n-2, k) + T(n-2, k-1), T(0, 0) = 1, T(1, 0) = -1, T(1, 1) = 1, T(n, k) = 0 if k < 0 or if k > n. - Philippe Deléham, Jan 11 2014
exp(x) * e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)*(-1 + x + x^2/2! + x^3/3!) = -1 + 2*x^2/2! + 6*x^3/3! + 13*x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ). - Peter Bala, Dec 21 2014

A052953 Expansion of 2*(1-x-x^2)/((1-x)*(1+x)*(1-2*x)).

Original entry on oeis.org

2, 2, 4, 6, 12, 22, 44, 86, 172, 342, 684, 1366, 2732, 5462, 10924, 21846, 43692, 87382, 174764, 349526, 699052, 1398102, 2796204, 5592406, 11184812, 22369622, 44739244, 89478486, 178956972, 357913942, 715827884, 1431655766, 2863311532
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n) = sum of absolute values of terms in the (n+1)-th row of the triangle in A108561; - Reinhard Zumkeller, Jun 10 2005
a(n) = A078008(n+1) + 2*(1 + n mod 2). - Reinhard Zumkeller, Jun 10 2005
Essentially the same as A128209. - R. J. Mathar, Jun 14 2008

Crossrefs

Apart from initial term, equals A026644(n+1) + 2.
Cf. A001045.

Programs

  • GAP
    List([0..40], n-> (2^(n+1) +3 +(-1)^n)/3); # G. C. Greubel, Oct 21 2019
  • Magma
    [(2^(n+1) +3 +(-1)^n)/3: n in [0..40]]; // G. C. Greubel, Oct 21 2019
    
  • Maple
    spec:= [S,{S=Union(Sequence(Union(Prod(Union(Z,Z),Z),Z)),Sequence(Z))}, unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    seq((2^(n+1) +3 +(-1)^n)/3, n=0..40); # G. C. Greubel, Oct 21 2019
  • Mathematica
    LinearRecurrence[{2,1,-2}, {2,2,4}, 40] (* G. C. Greubel, Oct 22 2019 *)
    CoefficientList[Series[2(1-x-x^2)/((1-x)(1+x)(1-2x)),{x,0,40}],x] (* Harvey P. Dale, Aug 03 2025 *)
  • PARI
    vector(41, n, (2^n +3 -(-1)^n)/3 ) \\ G. C. Greubel, Oct 21 2019
    
  • Sage
    [(2^(n+1) +3 +(-1)^n)/3 for n in (0..40)] # G. C. Greubel, Oct 21 2019
    

Formula

G.f.: 2*(1-x-x^2)/((1-x^2)*(1-2*x)).
a(n) = a(n-1) + 2*a(n-2) - 2.
a(n) = 1 + Sum_{alpha=RootOf(-1+z+2*z^2)} (1 + 4*alpha)*alpha^(-1-n)/9.
a(2n) = 2*a(n-1)-2, a(2n+1) = 2*a(2n). - Lee Hae-hwang, Oct 11 2002
From Paul Barry, May 24 2004: (Start)
a(n) = A001045(n+1) + 1.
a(n) = (2^(n+1) - (-1)^(n+1))/3 + 1. (End)
E.g.f.: (2*exp(2*x) + 3*exp(x) + exp(-x))/3. - G. C. Greubel, Oct 21 2019

Extensions

More terms from James Sellers, Jun 05 2000

A080242 Table of coefficients of polynomials P(n,x) defined by the relation P(n,x) = (1+x)*P(n-1,x) + (-x)^(n+1).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 3, 4, 2, 1, 1, 4, 7, 6, 3, 1, 5, 11, 13, 9, 3, 1, 1, 6, 16, 24, 22, 12, 4, 1, 7, 22, 40, 46, 34, 16, 4, 1, 1, 8, 29, 62, 86, 80, 50, 20, 5, 1, 9, 37, 91, 148, 166, 130, 70, 25, 5, 1, 1, 10, 46, 128, 239, 314, 296, 200, 95
Offset: 0

Views

Author

Paul Barry, Feb 12 2003

Keywords

Comments

Values generate solutions to the recurrence a(n) = a(n-1) + k(k+1)* a(n-2), a(0)=1, a(1) = k(k+1)+1. Values and sequences associated with this table are included in A072024.

Examples

			Rows are {1}, {1,1,1}, {1,2,2}, {1,3,4,2,1}, {1,4,7,6,3}, ... This is the same as table A035317 with an extra 1 at the end of every second row.
Triangle begins
  1;
  1,  1,  1;
  1,  2,  2;
  1,  3,  4,  2,  1;
  1,  4,  7,  6,  3;
  1,  5, 11, 13,  9,  3,  1;
  1,  6, 16, 24, 22, 12,  4;
  1,  7, 22, 40, 46, 34, 16,  4,  1;
  1,  8, 29, 62, 86, 80, 50, 20,  5;
		

Crossrefs

Similar to the triangles A059259, A035317, A108561, A112555. Cf. A059260.
Cf. A001045 (row sums).

Programs

  • Mathematica
    Table[CoefficientList[Series[((1+x)^(n+2) -(-1)^n*x^(n+2))/(1+2*x), {x, 0, n+2}], x], {n, 0, 10}]//Flatten (* G. C. Greubel, Feb 18 2019 *)

Formula

Rows are generated by P(n,x) = ((x+1)^(n+2) - (-x)^(n+2))/(2*x+1).
The polynomials P(n,-x), n > 0, satisfy a Riemann hypothesis: their zeros lie on the vertical line Re x = 1/2 in the complex plane.
O.g.f.: (1+x*t+x^2*t)/((1+x*t)(1-t-x*t)) = 1 + (1+x+x^2)*t + (1+2x+2x^2)*t^2 + ... . - Peter Bala, Oct 24 2007
T(n,k) = if(k<=2*floor((n+1)/2), Sum_{j=0..floor((n+1)/2)} binomial(n-2j,k-2j), 0). - Paul Barry, Apr 08 2011 (This formula produces the odd numbered rows correctly, but not the even. - G. C. Greubel, Feb 22 2019)

A279006 Alternating Jacobsthal triangle read by rows (second version).

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, -1, 1, 1, 1, -2, 2, 0, 1, 1, -3, 4, -2, 1, 1, 1, -4, 7, -6, 3, 0, 1, 1, -5, 11, -13, 9, -3, 1, 1, 1, -6, 16, -24, 22, -12, 4, 0, 1, 1, -7, 22, -40, 46, -34, 16, -4, 1, 1, 1, -8, 29, -62, 86, -80, 50, -20, 5, 0, 1, 1, -9, 37, -91, 148, -166, 130, -70, 25, -5, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Dec 07 2016

Keywords

Examples

			Triangle begins:
  1,
  1,   1,
  1,   0,   1,
  1,  -1,   1,   1,
  1,  -2,   2,   0,   1,
  1,  -3,   4,  -2,   1,   1,
  1,  -4,   7,  -6,   3,   0,   1,
  1,  -5,  11, -13,   9,  -3,   1,   1,
  1,  -6,  16, -24,  22, -12,   4,   0,   1,
  ...
		

Crossrefs

See A112468, A112555 and A108561 for other versions.

Programs

  • Maple
    T := (n, k) -> local j; add((-1)^j*binomial(n-k-1+j, j), j = 0..k):
    seq(print(seq(T(n, k), k = 0..n)), n = 0..9);  # Peter Luschny, Aug 30 2024
  • Mathematica
    T[i_, i_] = T[, 0] = 1; T[i, j_] := T[i, j] = T[i-1, j] - T[i-1, j-1];
    Table[T[i, j], {i, 0, 11}, {j, 0, i}] // Flatten (* Jean-François Alcover, Sep 06 2018 *)
    T[n_, k_] := 2^k*Hypergeometric2F1[-n, -k, -k, 1/2]; Table[T[n, k], {n, 0, 11}, {k, 0, n}]//Flatten (* Detlef Meya, Aug 30 2024 *)
  • PARI
    \\ using arxiv (3.1) and (3.7) formulas where A is A220074 and B is this sequence
    A(i, j) = if ((i < 0), 0, if (j==0, 1, A(i - 1, j - 1) - A(i - 1, j))); \\ A220074
    B(i, j) = A(i, i-j);
    tabl(nn) = for (i=0, nn, for (j=0, i, print1(B(i,j), ", ")); print()); \\ Michel Marcus, Jun 17 2017

Formula

T(i, j) = A220074(i, i-j). See (3.7) in arxiv link. - Michel Marcus, Jun 17 2017
T(n, k) = 2^k*hypergeom([-n, -k], [-k], 1/2). - Detlef Meya, Aug 30 2024

Extensions

More terms from Michel Marcus, Jun 17 2017

A220074 Triangle read by rows giving coefficients T(n,k) of [x^(n-k)] in Sum_{i=0..n} (x-1)^i, 0 <= n <= k.

Original entry on oeis.org

1, 1, 0, 1, -1, 1, 1, -2, 2, 0, 1, -3, 4, -2, 1, 1, -4, 7, -6, 3, 0, 1, -5, 11, -13, 9, -3, 1, 1, -6, 16, -24, 22, -12, 4, 0, 1, -7, 22, -40, 46, -34, 16, -4, 1, 1, -8, 29, -62, 86, -80, 50, -20, 5, 0, 1, -9, 37, -91, 148, -166, 130, -70, 25, -5, 1
Offset: 0

Views

Author

Mokhtar Mohamed, Dec 03 2012

Keywords

Comments

If the triangle is viewed as a square array S(m, k) = T(m+k, k), 0 <= m, 0 <= k, its first row is (1,0,1,0,1,...) with e.g.f. cosh(x), g.f. 1/(1-x^2) and subsequent rows have g.f. 1/((1+x)^n*(1-x^2)) (substitute x for -x in g.f. for A059259).
By column, S(m, k) is the coefficient of [x^m] in the generating function Sum_{i=0..k} (-1)^i/(1-x)^(i+1).
This is a rational generating function down column k with a power of (1-x) in the denominator; therefore column k is a polynomial in m respectively n. - Mathew Englander, May 14 2014
Column k multiplied by k! seems to correspond to row k of A054651, considered as a polynomial and then evaluated on the negative integers. For example, row 5 of A054651 represents the polynomial x^5 - 5*x^4 + 25*x^3 + 5*x^2 + 94*x + 120. Evaluating that for x = -1, x = -2, x = -3, ... gives (0, -360, -1440, -4080, -9600, -19920, -37680, ...) which is 5! times column 5 of this triangle. - Mathew Englander, May 23 2014
This triangle provides a solution to a question in the mathematics of gambling. For 0 < p < 1 and positive integers N and G with N < G, suppose you begin with N dollars and make repeated wagers, each time winning 1 dollar with probability p and losing 1 dollar with probability 1-p. You continue betting 1 dollar at a time until you have either G dollars (your Goal) or 0 (bankrupt). What is the probability of reaching your Goal before going bankrupt, as a function of p, N, and G? (This is a type of one-dimensional random walk.) Answer: Let Q_m_(x) be the polynomial whose coefficients are given by row m-1 of the triangle (e.g., Q_6_(x) = 1 - 4x + 7x^2 - 6x^3 + 3x^4). Then, the probability of reaching G dollars before going bankrupt is p^(G-N)*Q_N_(p)/Q_G_(p). - Mathew Englander, May 23 2014
From Paul Curtz, Mar 17 2017: (Start)
Consider the triangle Ja(n+1,k) (here, but generally Ja(n,k)) composed of the triangle a(n) prepended with a column of 0's, i.e.,
0;
0, 1;
0, 1, 0;
0, 1, -1, 1;
0, 1, -2, 2, 0;
0, 1, -3, 4, -2, 1;
0, 1, -4, 7, -6, 3, 0;
0, 1, -5, 11, -13, 9, -3, 1;
... .
The row sums are 0, 1, 1, ... = A057427(n), the most elementary autosequence of the first kind (a sequence of the first kind has 0's as main diagonal of its array of successive differences).
The row sums of the absolute values are A001045(n).
Ja applied to a sequence written in its reluctant form yields an autosequence of the first kind. Example: the reluctant form of A001045(n) is 0, 0, 1, 0, 1, 1, 0, 1, 1, 3, 0, 1, 1, 3, 5, ... = Jl.
Jl multiplied by Ja gives the triangle Jal:
0;
0, 1;
0, 1, 0;
0, 1, -1, 3;
0, 1, -2, 6, 0;
0, 1, -3, 12, -10, 11;
0, 1, -4, 21, -30, 33, 0;
0, 1, -5, 33, -65, 99, -63, 43;
... .
The row sums are A001045(n). (End)

Examples

			Triangle begins:
  1;
  1,   0;
  1,  -1,   1;
  1,  -2,   2,    0;
  1,  -3,   4,   -2,    1;
  1,  -4,   7,   -6,    3,    0;
  1,  -5,  11,  -13,    9,   -3,    1;
  1,  -6,  16,  -24,   22,  -12,    4,    0;
  1,  -7,  22,  -40,   46,  -34,   16,   -4,   1;
  1,  -8,  29,  -62,   86,  -80,   50,  -20,   5,   0;
  1,  -9,  37,  -91,  148, -166,  130,  -70,  25,  -5, 1;
  1, -10,  46, -128,  239, -314,  296, -200,  95, -30, 6, 0;
  ...
		

Crossrefs

Similar to the triangles A080242, A108561, A112555, A071920.
Cf. A000124 (column 2), A003600 (column 3), A223718 (column 4, conjectured), A257890 (column 5).

Programs

  • GAP
    Flat(List([0..12], n-> List([0..n], k-> Sum([0..k], j-> (-1)^j*Binomial(n-k+j, j))))); # G. C. Greubel, Feb 18 2019
  • Magma
    [[(&+[(-1)^j*Binomial(n-k+j, j): j in [0..k]]): k in [0..n]]: n in [0..12]]; // G. C. Greubel, Feb 18 2019
    
  • Maple
    A059259A := proc(n,k)
        1/(1+y)/(1-x-y) ;
        coeftayl(%,x=0,n) ;
        coeftayl(%,y=0,k) ;
    end proc:
    A059259 := proc(n,k)
        A059259A(n-k,k) ;
    end proc:
    A220074 := proc(i,j)
        (-1)^j*A059259(i,j) ;
    end proc: # R. J. Mathar, May 14 2014
  • Mathematica
    Table[Sum[(-1)^i*Binomial[n-k+i,i], {i, 0, k}], {n, 0, 12}, {k, 0, n} ]//Flatten (* Michael De Vlieger, Jan 27 2016 *)
  • PARI
    {T(n,k) = sum(j=0,k, (-1)^j*binomial(n-k+j,j))};
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Feb 18 2019
    
  • Sage
    [[sum((-1)^j*binomial(n-k+j,j) for j in (0..k)) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Feb 18 2019
    

Formula

Sum_{k=0..n} T(n,k) = 1.
T(n,k) = Sum_{i=0..k} (-1)^i*binomial(n-k+i, i).
T(2*n,n) = (-1)^n*A026641(n).
T(n,k) = (-1)^k*A059259(n,k).
T(n,0) = 1, T(n,n) = (1+(-1)^n)/2, and T(n,k) = T(n-1,k) - T(n-1,k-1) for 0 < k < n. - Mathew Englander, May 24 2014

Extensions

Definition and comments clarified by Li-yao Xia, May 15 2014
Previous Showing 11-20 of 22 results. Next