cp's OEIS Frontend

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

Showing 1-10 of 10 results.

A026637 Triangular array T read by rows: T(n,0) = T(n,n) = 1 for n >= 0, T(n,1) = T(n,n-1) = floor((3*n-1)/2) for n >= 1, otherwise T(n,k) = T(n-1,k-1) + T(n-1,k) for 2 <= k <= n-2, n >= 4.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 4, 1, 1, 5, 8, 5, 1, 1, 7, 13, 13, 7, 1, 1, 8, 20, 26, 20, 8, 1, 1, 10, 28, 46, 46, 28, 10, 1, 1, 11, 38, 74, 92, 74, 38, 11, 1, 1, 13, 49, 112, 166, 166, 112, 49, 13, 1, 1, 14, 62, 161, 278, 332, 278, 161, 62, 14, 1, 1, 16, 76, 223, 439, 610, 610, 439, 223, 76, 16, 1
Offset: 0

Views

Author

Keywords

Comments

T(n, k) = number of paths from (0, 0) to (n-k, k) in directed graph having vertices (i, j) and edges (i, j)-to-(i+1, j) and (i, j)-to-(i, j+1) for i, j >= 0 and edges (i, j)-to-(i+1, j+1) for i=0, j >= 1 and odd and for j=0, i >= 1 and odd.
See A228053 for a sequence with many terms in common with this one. - T. D. Noe, Aug 07 2013

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  2,  1;
  1,  4,  4,   1;
  1,  5,  8,   5,   1;
  1,  7, 13,  13,   7,   1;
  1,  8, 20,  26,  20,   8,   1;
  1, 10, 28,  46,  46,  28,  10,   1;
  1, 11, 38,  74,  92,  74,  38,  11,  1;
  1, 13, 49, 112, 166, 166, 112,  49, 13,  1;
  1, 14, 62, 161, 278, 332, 278, 161, 62, 14,  1;
		

Crossrefs

Sums include: A000007 (alternating sign row), A026644 (row), A026645, A026646, A026647 (diagonal).

Programs

  • Haskell
    a026637 n k = a026637_tabl !! n !! k
    a026637_row n = a026637_tabl !! n
    a026637_tabl = [1] : [1,1] : map (fst . snd)
       (iterate f (0, ([1,2,1], [0,1,1,0]))) where
       f (i, (xs, ws)) = (1 - i,
         if i == 1 then (ys, ws) else (zipWith (+) ys ws, ws'))
            where ys = zipWith (+) ([0] ++ xs) (xs ++ [0])
                  ws' = [0,1,0,0] ++ drop 2 ws
    -- Reinhard Zumkeller, Aug 08 2013
    
  • Magma
    function T(n,k) // T = A026637
       if k eq 0 or k eq n then return 1;
       elif k eq 1 or k eq n-1 then return Floor((3*n-1)/2);
       else return T(n-1, k) + T(n-1, k-1);
       end if;
    end function;
    [T(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Jun 28 2024
    
  • Maple
    A026637 := proc(n,k)
          option remember;
          if k=0 or k=n then
            1
        elif k=1 or k=n-1 then
            floor((3*n-1)/2) ;
        elif k <0 or k > n then
            0;
        else
            procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc: # R. J. Mathar, Apr 26 2015
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 0 || k == n, 1, k == 1 || k == n-1, Floor[(3n-1)/2], k < 0 || k > n, 0, True, T[n-1, k-1] + T[n-1, k]];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 30 2018 *)
  • SageMath
    def T(n,k): # T = A026637
        if k==0 or k==n: return 1
        elif k==1 or k==n-1: return ((3*n-1)//2)
        else: return T(n-1, k) + T(n-1, k-1)
    flatten([[T(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Jun 28 2024

Formula

From G. C. Greubel, Jun 28 2024: (Start)
T(n, n-k) = T(n, k).
T(2*n-1, n-1) = A026641(n), n >= 1.
Sum_{k=0..n} T(n, k) = A026644(n).
Sum_{k=0..n} (-1)^k*T(n, k) = A000007(n). (End)

A014430 Subtract 1 from Pascal's triangle, read by rows.

Original entry on oeis.org

1, 2, 2, 3, 5, 3, 4, 9, 9, 4, 5, 14, 19, 14, 5, 6, 20, 34, 34, 20, 6, 7, 27, 55, 69, 55, 27, 7, 8, 35, 83, 125, 125, 83, 35, 8, 9, 44, 119, 209, 251, 209, 119, 44, 9, 10, 54, 164, 329, 461, 461, 329, 164, 54, 10, 11, 65, 219, 494, 791, 923, 791, 494, 219, 65, 11
Offset: 0

Views

Author

Keywords

Comments

Each value of the sequence (T(x,y)) is equal to the sum of all values in Pascal's Triangle that are in the rectangle defined by the tip (0,0) and the position (x,y). - Florian Kleedorfer (florian.kleedorfer(AT)austria.fm), May 23 2005
To clarify T(n,k) and A129696: We subtract I = Identity matrix from Pascal's triangle to obtain the beheaded variant, A074909. Then take column sums starting from the top of A074909 to get triangle A014430. Row sums of the inverse of triangle T(n,k) gives the Bernoulli numbers, A027641/A026642. Alternatively, triangle T(n,k) as an infinite lower triangular matrix * [the Bernoulli numbers as a vector] = [1, 1, 1, ...]. Given the B_n version starting (1, 1/2, 1/6, ...) triangle T(n,k) * the B_n vector [1, 1/2, 1/6, 0, -1/30, ...] = the triangular numbers. - Gary W. Adamson, Mar 13 2012
From R. J. Mathar, Apr 25 2016: (Start)
If regarded as a symmetric array of the form
1 2 3 4 5 ...
2 5 9 14 20 ...
3 9 19 34 55 ...
4 14 34 69 125 ...
5 20 55 125 251 ...
6 27 83 209 461 ...
7 35 119 329 791 ...
8 44 164 494 1286 ...
9 54 219 714 2001 ...
it contains the rows (and columns) A000096, A062748, A063258, A062988, A124089, ..., A035927 and so on and counts the multisets of digits of numbers in base b>=2 with d>=1 digits (equivalent to the comment in A035927). (End)
Proof of Florian Kleedorfer's formula: Take sums of the columns of the rectangle - these are all binomial coefficients by the Hockey Stick Identity. Note the locations of these coefficients: They form a row going almost all the way to the edge, only missing the 1 - apply the Hockey Stick Identity again. - James East, Jul 03 2020

Examples

			Triangle begins:
  1;
  2,  2;
  3,  5,  3;
  4,  9,  9,   4;
  5, 14, 19,  14,   5;
  6, 20, 34,  34,  20,  6;
  7, 27, 55,  69,  55, 27,  7;
  8, 35, 83, 125, 125, 83, 35, 8;
		

Crossrefs

Triangle with zeros: A014473.
Cf. A000295 (row sums).

Programs

  • Haskell
    a014430 n k = a014430_tabl !! n !! k
    a014430_row n = a014430_tabl !! n
    a014430_tabl = map (init . tail) $ drop 2 a014473_tabl
    -- Reinhard Zumkeller, Apr 10 2012
    
  • Magma
    [Binomial(n+2,k+1)-1: k in [0..n], n in [0..13]]; // G. C. Greubel, Feb 25 2023
    
  • Mathematica
    Table[Sum[Sum[Binomial[m, j], {m, j, j+(n-k)}], {j,0,k}], {n,0,10}, {k, 0,n}]//Flatten (* Michael De Vlieger, Sep 01 2020 *)
    Table[Binomial[n+2,k+1] -1, {n,0,13}, {k,0,n}]//Flatten (* G. C. Greubel, Feb 25 2023 *)
  • SageMath
    flatten([[binomial(n+2,k+1)-1 for k in range(n+1)] for n in range(14)]) # G. C. Greubel, Feb 25 2023

Formula

T(n, k) = T(n-1, k) + T(n-1, k-1) + 1, T(0, 0)=1. - Ralf Stephan, Jan 23 2005
G.f.: 1 / ((1-x)*(1-x*y)*(1-x*(1+y))). - Ralf Stephan, Jan 24 2005
T(n, k) = Sum_{j=0..k} Sum_{m=j..j+(n-k)} binomial(m, j). - Florian Kleedorfer (florian.kleedorfer(AT)austria.fm), May 23 2005
T(n, k) = binomial(n+2, k+1) - 1. - G. C. Greubel, Feb 25 2023

Extensions

More terms from Erich Friedman
Offset fixed by Reinhard Zumkeller, Apr 10 2012

A026638 a(n) = A026637(2*n, n).

Original entry on oeis.org

1, 2, 8, 26, 92, 332, 1220, 4538, 17036, 64412, 244928, 935684, 3588392, 13806704, 53271548, 206040506, 798600332, 3101109164, 12062148368, 46986821516, 183276382472, 715748620424, 2798274135368, 10951009023716, 42895901012792, 168167959150232, 659793819847040
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 2 select 2^(2*n-1) else ((7*n-4)*Self(n-1) + 2*(2*n-1)*Self(n-2))/(2*n): n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    CoefficientList[Series[1/(2+x)+3/((2+x)*Sqrt[1-4*x])-1,{x,0,20}],x] (* Vaclav Kotesovec, Oct 21 2012 *)
  • PARI
    my(x='x+O('x^66)); Vec( 1/(2+x)+3/((2+x)*sqrt(1-4*x))-1 ) \\ Joerg Arndt, May 04 2013
    
  • SageMath
    @CachedFunction
    def a(n): # a = A026638
        if n<3: return 2^(n*(n+1)/2)
        else: return ((7*n-4)*a(n-1) + 2*(2*n-1)*a(n-2))/(2*n)
    [a(n) for n in range(41)] # G. C. Greubel, Jul 01 2024

Formula

From Vaclav Kotesovec, Oct 21 2012: (Start)
G.f.: (3 - (x+1)*sqrt(1-4*x))/((x+2)*sqrt(1-4*x)).
Recurrence: 2*n*a(n) = (7*n-4)*a(n-1) + 2*(2*n-1)*a(n-2).
a(n) ~ 2^(2*n+2)/(3*sqrt(Pi*n)) (End)

A026639 a(n) = A026637(2*n, n-1).

Original entry on oeis.org

1, 5, 20, 74, 278, 1049, 3980, 15170, 58052, 222914, 858512, 3314960, 12829070, 49748705, 193259660, 751954250, 2929965020, 11431262390, 44651369720, 174597927740, 683388447260, 2677230376490, 10496941482680, 41188078562324
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 2 select 5*(3*n-2) else ((7*n^2+10*n+4)*Self(n-1) + 2*(2*n+1)*(n+1)*Self(n-2))/(2*n*(n+2)): n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    a[n_]:= a[n]= If[n<4, (5*4^(n-1) -Boole[n==1])/4, ((7*n^2-4*n+1)*a[n- 1] +2*n*(2*n-1)*a[n-2])/(2*(n^2-1))];
    Table[a[n], {n,40}] (* G. C. Greubel, Jul 01 2024 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A026639
        if n<4: return (5*4^(n-1) - 0^(n-1))/4
        else: return ((7*n^2 - 4*n + 1)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n^2-1))
    [a(n) for n in range(1,41)] # G. C. Greubel, Jul 01 2024

Formula

a(n) = ((7*n^2 - 4*n + 1)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n^2-1)), with a(0) = 1, a(1) = 5, a(2) = 20. - G. C. Greubel, Jul 01 2024

A026640 a(n) = A026637(2*n, n-2).

Original entry on oeis.org

1, 8, 38, 161, 662, 2672, 10676, 42398, 167756, 662252, 2610758, 10283861, 40490702, 159394424, 627456188, 2470223186, 9726696572, 38308366784, 150916209308, 594704861546, 2344206594332, 9243186573248, 36456892635848
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 2 select 4^(n+1) -3^(n+1) +1 else ((7*n^2+24*n+24 )*Self(n-1) + 2*(2*n+3)*(n+2)*Self(n-2))/(2*n*(n+4)): n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    a[n_]:= a[n]= If[n<5, 4^(n-1) -3^(n-1) +1 -Boole[n==2], ((7*n^2 -4*n + 4)*a[n-1] +2*n*(2*n-1)*a[n-2])/(2*(n-2)*(n+2))];
    Table[a[n], {n,2,40}] (* G. C. Greubel, Jul 01 2024 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A026640
        if n<5: return 4^(n-1) -3^(n-1) +1 -int(n==2)
        else: return ((7*n^2-4*n+4)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n-2)*(n+2))
    [a(n) for n in range(2,41)] # G. C. Greubel, Jul 01 2024

Formula

a(n) = ((7*n^2 - 4*n + 4)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n-2)*(n+2)), n >= 5. - G. C. Greubel, Jul 01 2024

A026643 a(n) = A026637(n, floor(n/2)).

Original entry on oeis.org

1, 1, 2, 4, 8, 13, 26, 46, 92, 166, 332, 610, 1220, 2269, 4538, 8518, 17036, 32206, 64412, 122464, 244928, 467842, 935684, 1794196, 3588392, 6903352, 13806704, 26635774, 53271548, 103020253, 206040506, 399300166, 798600332
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 4 select 2^(n-1) else (4*Self(n-1) +(7*n-9)*Self(n-2) +2*Self(n-3) +4*(n-1)*Self(n-4))/(2*(n+1)): n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    T[n_, k_]:= T[n, k] = If[k==0 || k==n, 1, If[k==1 || k==n-1, Floor[(3*n -1)/2], T[n-1,k-1] + T[n-1,k] ]]; (* A026637 *)
    A026643[n_]:= T[n, Floor[n/2]];
    Table[A026643[n], {n,0,40}] (* G. C. Greubel, Jul 01 2024 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A026643
        if n<5: return (1,1,2,4,8)[n]
        else: return (4*a(n-1) +(7*n-9)*a(n-2) +2*a(n-3) +4*(n-1)*a(n-4))/(2*(n+1))
    [a(n) for n in range(41)] # G. C. Greubel, Jul 01 2024

Formula

a(n) = (4*a(n-1) + (7*n-9)*a(n-2) + 2*a(n-3) + 4*(n-1)*a(n-4))/(2*(n+1)) with a(0) = a(1) = 1, a(2) = 2, a(3) = 4, a(4) = 8. - G. C. Greubel, Jul 01 2024

A026646 a(n) = Sum_{i=0..n} Sum_{j=0..n} A026637(i,j).

Original entry on oeis.org

1, 3, 7, 17, 37, 79, 163, 333, 673, 1355, 2719, 5449, 10909, 21831, 43675, 87365, 174745, 349507, 699031, 1398081, 2796181, 5592383, 11184787, 22369597, 44739217, 89478459, 178956943, 357913913, 715827853, 1431655735
Offset: 0

Views

Author

Keywords

Comments

a(n) indexes the corner blocks on the Jacobsthal spiral built from blocks of unit area (using J(1) and J(2) as the sides of the first block). - Paul Barry, Mar 06 2008
Partial sums of A026644, which are the row sums of A026637. - Paul Barry, Mar 06 2008

Crossrefs

Programs

  • Magma
    [(2^(n+4) -(6*n+9+(-1)^n))/6: n in [0..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    CoefficientList[Series[(1-x^2+2x^3)/((1-x)(1-2x)(1-x^2)), {x, 0, 29}], x] (* Metin Sariyar, Sep 22 2019 *)
    LinearRecurrence[{3,-1,-3,2}, {1,3,7,17}, 41] (* G. C. Greubel, Jul 01 2024 *)
  • SageMath
    [(2^(n+4) - (-1)^n -9 - 6*n)/6 for n in range(41)] # G. C. Greubel, Jul 01 2024

Formula

G.f.: (1 -x^2 +2*x^3)/((1-x)*(1-2*x)*(1-x^2)). - Ralf Stephan, Apr 30 2004
From Paul Barry, Mar 06 2008: (Start)
a(n) = A001045(n+3) - 2*floor((n+2)/2).
a(n) = -n + Sum_{k=0..n} A001045(k+2) = A084639(n+1) - n. (End)
a(n+1) = 2*a(n) + A109613(n), a(0)=1. - Paul Curtz, Sep 22 2019

A026647 a(n) = Sum_{k=0..floor(n/2)} A026637(n-k, k).

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 17, 27, 45, 73, 119, 192, 312, 505, 818, 1323, 2142, 3466, 5609, 9075, 14685, 23761, 38447, 62208, 100656, 162865, 263522, 426387, 689910, 1116298, 1806209, 2922507, 4728717, 7651225, 12379943, 20031168
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 5 select Binomial(n, Floor(n/2)) else Self(n-2) +Self(n-3) +2*Self(n-4) +Self(n-5) +3: n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    a[n_]:= a[n]= If[n<6, Binomial[n, Floor[n/2]], a[n-2] +a[n-3] +2*a[n- 4] +a[n-5] +3]; (* a = A026647 *)
    Table[a[n], {n,0,40}] (* G. C. Greubel, Jul 01 2024 *)
    LinearRecurrence[{1,1,0,1,-1,-1},{1,1,2,3,6,10,17},40] (* Harvey P. Dale, Jan 19 2025 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A026647
        if n<6: return binomial(n, n//2)
        else: return a(n-2) + a(n-3) + 2*a(n-4) + a(n-5) + 3
    [a(n) for n in range(41)] # G. C. Greubel, Jul 01 2024

Formula

G.f.: (1 + x^5 + x^6)/((1-x^4)*(1-x-x^2)).
From G. C. Greubel, Jul 01 2024: (Start)
a(n) = [n=0] - (3/4) + (1/4)*(-1)^n - (1/10)*2^((1-(-1)^n)/2)*(-1)^floor((n+1)/2) + (3/5)*LucasL(n+1).
a(n) = (1/20)*( 12*LucasL(n+1) + 5*(-1)^n - 15 - 2*cos(n*Pi/2) + 4*sin(n*Pi/2) ) + [n=0].
a(n) = a(n-2) + a(n-3) + 2*a(n-4) + a(n-5) + 3, with a(0) = a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 6, a(5) = 10. (End)

A026645 a(n) = Sum_{k=0..floor(n/2)} A026637(n, k).

Original entry on oeis.org

1, 1, 3, 5, 14, 21, 55, 85, 216, 341, 848, 1365, 3340, 5461, 13191, 21845, 52208, 87381, 206968, 349525, 821514, 1398101, 3264044, 5592405, 12979006, 22369621, 51642594, 89478485, 205592744, 357913941, 818848135, 1431655765, 3262611696, 5726623061, 13003800704, 22906492245
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, If[k==1 || k==n-1, Floor[(3*n- 1)/2], T[n-1,k] + T[n-1,k-1] ]];
    A026645[n_]:= Sum[T[n, k], {k, 0, Floor[n/2]}];
    Table[A026645[n], {n,0,40}] (* G. C. Greubel, Jun 29 2024 *)
  • SageMath
    @CachedFunction
    def T(n,k): # T = A026637
        if k==0 or k==n: return 1
        elif k==1 or k==n-1: return ((3*n-1)//2)
        else: return T(n-1, k) + T(n-1, k-1)
    def A026645(n): return sum(T(n,k) for k in range((n//2)+1))
    [A026645(n) for n in range(41)] # G. C. Greubel, Jun 29 2024

A209518 Triangle by rows, reversal of A104712.

Original entry on oeis.org

1, 1, 3, 1, 4, 6, 1, 5, 10, 10, 1, 6, 15, 20, 15, 1, 7, 21, 35, 35, 21, 1, 8, 28, 56, 70, 56, 28, 1, 9, 36, 84, 126, 126, 84, 36, 1, 10, 45, 120, 210, 252, 210, 120, 45, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55
Offset: 0

Views

Author

Gary W. Adamson, Mar 09 2012

Keywords

Comments

The offset is chosen as "0" to match the generalized or compositional Bernoulli numbers.
Following [Blandin and Diaz], we can generalize a subset of Bernoulli numbers to comply with the origin of the triangle (the Pascal matrix A007318 beheaded once: (A074909), twice: (this triangle), and so on...); and a corresponding Bernoulli sequence that equals the inverse of the triangle, extracting the left border. This procedure done with A074909 results in The Bernoulli numbers (A027641/A026642) starting (1, -1/2, 1/6,...). Done with this triangle we obtain A006568/A006569: (1, -1/3, 1/18, 1/90,...).
A generalized algebraic property of the subset of such triangles and compositional Bernoulli numbers is that the triangle M * [corresponding Bernoulli sequence considered as a vector, V] = [1, 0, 0, 0,...].
The infinite set of generalized Bernoulli number sequences thus generated from variants of Pascal's triangle begins: [(1, -1/2, 1/6,...); (1, -1/3, 1/18,...); (1, -1/4, 1/40,...); (1, -1/5, 1/75,...); where the third term denominators = A002411 (1, 6, 18, 40, 75,...) after the "1".
Row sums of the triangle = A000295 starting (1, 4, 11, 26, 57,...).

Examples

			First few rows of the triangle =
1;
1, 3;
1, 4, 6;
1, 5, 10, 10;
1, 6, 15, 20, 15;
1, 7, 21, 35, 35, 21;
1, 8, 28, 56, 70, 56, 28;
1, 9, 36, 84, 126, 126, 84, 36;
1, 10, 45, 120, 210, 252, 210, 120, 45;
1, 11, 55, 165, 330, 462, 462, 30, 165, 55;
...
		

Crossrefs

Programs

  • Mathematica
    Table[Binomial[n+2, k+2], {n, 0, 9}, {k, n , 0, -1}] // Flatten (* Jean-François Alcover, Aug 08 2018 *)

Formula

Doubly beheaded variant of Pascal's triangle in which two rightmost diagonals are deleted.
T(n,k)=T(n-1,k)+3*T(n-1,k-1)-2*T(n-2,k-1)-3*T(n-2,k-2)+T(n-3,k-2)+T(n-3,k-3), T(0,0)=1, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Jan 11 2014
Showing 1-10 of 10 results.