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-6 of 6 results.

A027926 Triangular array T read by rows: T(n,0) = T(n,2n) = 1 for n >= 0; T(n,1) = 1 for n >= 1; T(n,k) = T(n-1,k-2) + T(n-1,k-1) for k = 2..2n-1, n >= 2.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 4, 3, 1, 1, 1, 2, 3, 5, 7, 7, 4, 1, 1, 1, 2, 3, 5, 8, 12, 14, 11, 5, 1, 1, 1, 2, 3, 5, 8, 13, 20, 26, 25, 16, 6, 1, 1, 1, 2, 3, 5, 8, 13, 21, 33, 46, 51, 41, 22, 7, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 54, 79, 97, 92, 63, 29, 8, 1
Offset: 0

Views

Author

Keywords

Comments

T(n,k) = number of strings s(0),...,s(n) such that s(0)=0, s(n)=n-k and for 1<=i<=n, s(i)=s(i-1)+d, with d in {0,1,2} if i=0, in {0,2} if s(i)=2i, in {0,1,2} if s(i)=2i-1, in {0,1} if 0<=s(i)<=2i-2.
Can be seen as concatenation of triangles A104763 and A105809, with identifying column of Fibonacci numbers, see example. - Reinhard Zumkeller, Aug 15 2013

Examples

			.   0:                           1
.   1:                        1  1   1
.   2:                     1  1  2   2   1
.   3:                  1  1  2  3   4   3   1
.   4:               1  1  2  3  5   7   7   4   1
.   5:            1  1  2  3  5  8  12  14  11   5   1
.   6:          1 1  2  3  5  8 13  20  26  25  16   6   1
.   7:        1 1 2  3  5  8 13 21  33  46  51  41  22   7   1
.   8:      1 1 2 3  5  8 13 21 34  54  79  97  92  63  29   8  1
.   9:    1 1 2 3 5  8 13 21 34 55  88 133 176 189 155  92  37  9  1
.  10:  1 1 2 3 5 8 13 21 34 55 89 143 221 309 365 344 247 129 46 10  1
.
.   1:                           1
.   2:                        1  1
.   3:                     1  1  2
.   4:                  1  1  2  3
.   5:               1  1  2  3  5      columns = A000045, > 0
.   6:            1  1  2  3  5  8     +---------+
.   7:          1 1  2  3  5  8 13     | A104763 |
.   8:        1 1 2  3  5  8 13 21     +---------+
.   9:      1 1 2 3  5  8 13 21 34
.  10:    1 1 2 3 5  8 13 21 34 55
.  11:  1 1 2 3 5 8 13 21 34 55 89
.
.   0:                           1
.   1:                           1   1                +---------+
.   2:                           2   2   1            | A105809 |
.   3:                           3   4   3   1        +---------+
.   4:                           5   7   7   4   1
.   5:                           8  12  14  11   5   1
.   6:                          13  20  26  25  16   6   1
.   7:                          21  33  46  51  41  22   7   1
.   8:                          34  54  79  97  92  63  29   8  1
.   9:                          55  88 133 176 189 155  92  37  9  1
.  10:                          89 143 221 309 365 344 247 129 46 10  1
		

Crossrefs

Many columns of T are A000045 (Fibonacci sequence), also in T: A001924, A004006, A000071, A000124, A014162, A014166, A027927-A027933.
Some other Fibonacci-Pascal triangles: A036355, A037027, A074829, A105809, A109906, A111006, A114197, A162741, A228074.

Programs

  • GAP
    Flat(List([0..10], n-> List([0..2*n], k-> Sum([0..Int((2*n-k+1)/2) ], j-> Binomial(n-j, 2*n-k-2*j) )))); # G. C. Greubel, Sep 05 2019
  • Haskell
    a027926 n k = a027926_tabf !! n !! k
    a027926_row n = a027926_tabf !! n
    a027926_tabf = iterate (\xs -> zipWith (+)
                                   ([0] ++ xs ++ [0]) ([1,0] ++ xs)) [1]
    -- Variant, cf. example:
    a027926_tabf' = zipWith (++) a104763_tabl (map tail a105809_tabl)
    -- Reinhard Zumkeller, Aug 15 2013
    
  • Magma
    [&+[Binomial(n-j, 2*n-k-2*j): j in [0..Floor((2*n-k+1)/2)]]: k in [0..2*n], n in [0..10]]; // G. C. Greubel, Sep 05 2019
    
  • Maple
    A027926 := proc(n,k)
        add(binomial(n-j,2*n-k-2*j),j=0..(2*n-k+1)/2) ;
    end proc: # R. J. Mathar, Apr 11 2016
  • Mathematica
    z = 15; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := 1;
    t[n_, k_] := t[n, k] = t[n - 1, k - 2] + t[n - 1, k - 1];
    u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
    TableForm[u] (* A027926 array *)
    v = Flatten[u] (* A027926 sequence *)
    (* Clark Kimberling, Aug 31 2014 *)
    Table[Sum[Binomial[n-j, 2*n-k-2*j], {j, 0, Floor[(2*n-k+1)/2]}], {n, 0, 10}, {k, 0, 2*n}]//Flatten (* G. C. Greubel, Sep 05 2019 *)
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, if( k<=1 || k==2*n, 1, T(n-1, k-2) + T(n-1, k-1)))}; /* _Michael Somos, Feb 26 1999 */
    
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, sum( j=max(0, k-n), k\2, binomial(k-j, j)))}; /* Michael Somos */
    
  • Sage
    [[sum(binomial(n-j, 2*n-k-2*j) for j in (0..floor((2*n-k+1)/2))) for k in (0..2*n)] for n in (0..10)] # G. C. Greubel, Sep 05 2019
    

Formula

T(n, k) = Sum_{j=0..floor((2*n-k+1)/2)} binomial(n-j, 2*n-k-2*j). - Len Smiley, Oct 21 2001

Extensions

Incorporates comments from Michael Somos.
Example extended by Reinhard Zumkeller, Aug 15 2013

A228074 A Fibonacci-Pascal triangle read by rows: T(n,0) = Fibonacci(n), T(n,n) = n and for n > 0: T(n,k) = T(n-1,k-1) + T(n-1,k), 0 < k < n.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 3, 4, 3, 3, 5, 7, 7, 4, 5, 8, 12, 14, 11, 5, 8, 13, 20, 26, 25, 16, 6, 13, 21, 33, 46, 51, 41, 22, 7, 21, 34, 54, 79, 97, 92, 63, 29, 8, 34, 55, 88, 133, 176, 189, 155, 92, 37, 9, 55, 89, 143, 221, 309, 365, 344, 247, 129, 46, 10
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 15 2013

Keywords

Comments

Sum of n-th row is 2^(n+1) - F(n+1) - 1 = A228078(n+1). - Greg Dresden and Sadek Mohammed, Aug 30 2022

Examples

			.    0:                                 0
.    1:                               1   1
.    2:                             1   2   2
.    3:                          2    3    4   3
.    4:                       3    5    7    7   4
.    5:                     5    8   12   14   11   5
.    6:                  8   13   20   26   25   16   6
.    7:               13   21   33   46   51   41   22   7
.    8:            21   34   54   79   97   92   63   29   8
.    9:          34   55   88  133  176  189  155   92   37   9
.   10:       55   89  143  221  309  365  344  247  129   46  10
.   11:     89  144  232  364  530  674  709  591  376  175  56   11
.   12:  144 233  376  596  894 1204 1383 1300  967  551  231  67   12 .
		

Crossrefs

Cf. A000045 (left edge), A001477 (right edge), A228078 (row sums), A027988 (maxima per row);
some other Fibonacci-Pascal triangles: A027926, A036355, A037027, A074829, A105809, A109906, A111006, A114197, A162741.

Programs

  • GAP
    T:= function(n,k)
        if k=0 then return Fibonacci(n);
        elif k=n then return n;
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Sep 05 2019
  • Haskell
    a228074 n k = a228074_tabl !! n !! k
    a228074_row n = a228074_tabl !! n
    a228074_tabl = map fst $ iterate
       (\(u:_, vs) -> (vs, zipWith (+) ([u] ++ vs) (vs ++ [1]))) ([0], [1,1])
    
  • Maple
    with(combinat);
    T:= proc (n, k) option remember;
    if k = 0 then fibonacci(n)
    elif k = n then n
    else T(n-1, k-1) + T(n-1, k)
    end if
    end proc;
    seq(seq(T(n, k), k = 0..n), n = 0..12); # G. C. Greubel, Sep 05 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0, Fibonacci[n], If[k==n, n, T[n-1, k-1] + T[n -1, k]]]; Table[T[n, k], {n,0,12}, {k,0,n}] (* G. C. Greubel, Sep 05 2019 *)
  • PARI
    T(n,k) = if(k==0, fibonacci(n), if(k==n, n, T(n-1, k-1) + T(n-1, k)));
    for(n=0, 12, for(k=0, n, print1(T(n,k), ", "))) \\ G. C. Greubel, Sep 05 2019
    
  • Sage
    def T(n, k):
        if (k==0): return fibonacci(n)
        elif (k==n): return n
        else: return T(n-1, k) + T(n-1, k-1)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Sep 05 2019
    

A292508 Number A(n,k) of partitions of n with k kinds of 1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 2, 1, 1, 3, 4, 3, 2, 1, 4, 7, 7, 5, 2, 1, 5, 11, 14, 12, 7, 4, 1, 6, 16, 25, 26, 19, 11, 4, 1, 7, 22, 41, 51, 45, 30, 15, 7, 1, 8, 29, 63, 92, 96, 75, 45, 22, 8, 1, 9, 37, 92, 155, 188, 171, 120, 67, 30, 12, 1, 10, 46, 129, 247, 343, 359, 291, 187, 97, 42, 14
Offset: 0

Views

Author

Alois P. Heinz, Sep 17 2017

Keywords

Comments

Partial sum operator applied to column k gives column k+1.
A(n,k) is also defined for k < 0. All given formulas and programs can be applied also if k is negative.

Examples

			Square array A(n,k) begins:
  1,  1,  1,   1,   1,    1,    1,    1,     1, ...
  0,  1,  2,   3,   4,    5,    6,    7,     8, ...
  1,  2,  4,   7,  11,   16,   22,   29,    37, ...
  1,  3,  7,  14,  25,   41,   63,   92,   129, ...
  2,  5, 12,  26,  51,   92,  155,  247,   376, ...
  2,  7, 19,  45,  96,  188,  343,  590,   966, ...
  4, 11, 30,  75, 171,  359,  702, 1292,  2258, ...
  4, 15, 45, 120, 291,  650, 1352, 2644,  4902, ...
  7, 22, 67, 187, 478, 1128, 2480, 5124, 10026, ...
		

Crossrefs

Rows n=0-4 give: A000012, A001477, A000124, A004006(k+1), A027927(k+3).
Main diagonal gives A292463.
A(n,n+1) gives A292613.

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(n=0, 1, add(
          (numtheory[sigma](j)+k-1)*A(n-j, k), j=1..n)/n)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..14);
    # second Maple program:
    A:= proc(n, k) option remember; `if`(n=0, 1, `if`(k<1,
          A(n, k+1)-A(n-1, k+1), `if`(k=1, combinat[numbpart](n),
          A(n-1, k)+A(n, k-1))))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..14);
    # third Maple program:
    b:= proc(n, i, k) option remember; `if`(n=0 or i<2,
          binomial(k+n-1, n), add(b(n-i*j, i-1, k), j=0..n/i))
        end:
    A:= (n, k)-> b(n$2, k):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n == 0 || i < 2, Binomial[k + n - 1, n], Sum[b[n - i*j, i - 1, k], {j, 0, n/i}]];
    A[n_, k_] := b[n, n, k];
    Table[A[n, d - n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, May 17 2018, translated from 3rd Maple program *)

Formula

G.f. of column k: 1/(1-x)^k * 1/Product_{j>1} (1-x^j).
Column k is Euler transform of k,1,1,1,... .
For fixed k>=0, A(n,k) ~ 2^((k-5)/2) * 3^((k-2)/2) * n^((k-3)/2) * exp(Pi*sqrt(2*n/3)) / Pi^(k-1). - Vaclav Kotesovec, Oct 24 2018

A362193 Number of Grassmannian permutations of size n that avoid a pattern, sigma, where sigma is a pattern of size 6 with exactly one descent.

Original entry on oeis.org

1, 1, 2, 5, 12, 27, 57, 113, 211, 373, 628, 1013, 1574, 2367, 3459, 4929, 6869, 9385, 12598, 16645, 21680, 27875, 35421, 44529, 55431, 68381, 83656, 101557, 122410, 146567, 174407, 206337, 242793, 284241, 331178, 384133, 443668, 510379, 584897
Offset: 0

Views

Author

Jessica A. Tomasko, Apr 10 2023

Keywords

Comments

A permutation is said to be Grassmannian if it has at most one descent. The definition for sigma is a pattern of size 6 with exactly one descent. For example, sigma can be chosen to be 124356, 241356, 361245, 512346, etc.

Crossrefs

Programs

  • Maple
    a:= n-> 1+(n-1)*n*(n+1)*(n*(n-5)+26)/120:
    seq(a(n), n=0..38);  # Alois P. Heinz, Apr 12 2023
  • Mathematica
    CoefficientList[Series[(1 - 5 x + 11 x^2 - 12 x^3 + 7 x^4 - x^5)/(1 - x)^6, {x, 0, 38}], x] (* Michael De Vlieger, Apr 12 2023 *)
  • PARI
    a(n) = 1 + sum(i=3, 6, binomial(n, i-1)) \\ Andrew Howroyd, Apr 10 2023

Formula

a(n) = 1 + Sum_{i=2..5} binomial(n,i).
G.f.: (1-5*x+11*x^2-12*x^3+7*x^4-x^5)/(1-x)^6.
a(0) = 1; a(1) = 1; a(n) = 1 + A027660(n-2), n >= 2. - Omar E. Pol, Apr 12 2023

A267707 a(n) = A000217(A000217(n)+1).

Original entry on oeis.org

1, 3, 10, 28, 66, 136, 253, 435, 703, 1081, 1596, 2278, 3160, 4278, 5671, 7381, 9453, 11935, 14878, 18336, 22366, 27028, 32385, 38503, 45451, 53301, 62128, 72010, 83028, 95266, 108811, 123753, 140185, 158203, 177906, 199396, 222778, 248160, 275653, 305371
Offset: 0

Views

Author

Waldemar Puszkarz, Jan 19 2016

Keywords

Comments

It is the sequence of triangular numbers (A000217) with progressive gaps that grow as 0,1,2,3, ... (consecutive numbers), by which I mean that the 0,1,2,3, ... consecutive triangular numbers are removed from A000217 to form this sequence. For instance, (1), 6, a triangular number, is missing between 3 and 10, which is the gap with 1 triangular number removed, (2), 15 and 21 (two consecutive triangular numbers) are missing between 10 and 28, which is the gap with 2 triangular numbers removed, and so on.
The differences between the consecutive terms of this sequence can be expressed through the sum of cubes of two numbers separated by 2 as (n^3+(n+2)^3)/4, which is the same as A229183, except for the first term in there.
The same pattern when applied to squares, A000290(A000290(n)+1), gives A082044(n). Triangular numbers are also linked in a similar manner to A027927(n) = A000217(A000217(n)+2)/3.

Examples

			For n=0, a(0)=1*2/2=1. For n=2, a(2)=4*5/2=10.
		

Crossrefs

Cf. A000217 (triangular numbers), A229183 (consecutive terms differences), A082044 (related sequence for squares), A027927 (related sequence for triangular numbers).

Programs

  • Magma
    I:=[1,3,10,28,66]; [n le 5 select I[n] else 5*Self(n-1)-10*Self(n-2)+10*Self(n-3)-5*Self(n-4)+Self(n-5): n in [1..50]]; // Vincenzo Librandi, Jan 22 2016
  • Mathematica
    S[n_] :=n*(n+1)/2; Table[S[S[n]+1], {n, 0, 50}]
    Table[(n*(n+1)/2+1)(n*(n+1)/2+2)/2, {n, 0, 50}]
    Table[(n^4+2*n^3+7*n^2+6*n+8)/8, {n, 0, 50}]
    CoefficientList[Series[(1 - 2 x + 5 x^2 - 2 x^3 + x^4) / (1 - x)^5, {x, 0, 33}], x] (* or *) LinearRecurrence[{5, -10, 10, -5, 1}, {1, 3, 10, 28, 66}, 50] (* Vincenzo Librandi, Jan 22 2016 *)
  • PARI
    for(n=0,50,print1((n^4+2*n^3+7*n^2+6*n+8)/8 ", "))
    

Formula

a(n) = A000217(A000217(n)+1) = (n*(n+1)/2+1)(n*(n+1)/2+2)/2.
a(n) = (n^4+2n^3+7n^2+6n+8)/8 = (n^2+n+2)(n^2+n+4)/8.
G.f.: (1-2*x+5*x^2-2*x^3+x^4)/(1-x)^5. - Vincenzo Librandi, Jan 22 2016
a(n) = 5*a(n-1)-10*a(n-2)+10*a(n-3)-5*a(n-4)+a(n-5). - Vincenzo Librandi, Jan 22 2016

A337977 Triangle T(n,m) = C(n-1,n-m)*Sum_{k=1..n} C(2*k-2,k-1)*C(n-m,m-k)/m, m>0, n>0, n>=m.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 6, 8, 5, 1, 10, 22, 26, 14, 1, 15, 50, 85, 90, 42, 1, 21, 100, 225, 348, 322, 132, 1, 28, 182, 525, 1050, 1442, 1176, 429, 1, 36, 308, 1120, 2730, 4928, 5992, 4356, 1430, 1, 45, 492, 2226, 6426, 14238, 22920, 24894, 16302, 4862
Offset: 1

Views

Author

Vladimir Kruchinin, Oct 05 2020

Keywords

Examples

			1,
1, 1,
1, 3,  2,
1, 6,  8,  5,
1,10, 22, 26, 14,
1,15, 50, 85, 90, 42,
1,21,100,225,348,322,132
		

Crossrefs

T(2*n,n) is A069720.
2nd column: A000217, 3rd column: 2*A006522 or 2*(A027927-1).

Programs

  • Mathematica
    Table[Binomial[n - 1, n - m] Sum[Binomial[2 k - 2, k - 1] Binomial[n - m, m - k]/m, {k, n}], {n, 10}, {m, n}] // Flatten (* Michael De Vlieger, Oct 05 2020 *)
  • Maxima
    T(n,m):=(binomial(n-1,n-m)*sum(binomial(2*k-2,k-1)*binomial(n-m,m-k),k,1,n))/m;

Formula

G.f.: A(x,y) = -(sqrt((2*sqrt(-4*x^2*y+x^2-2*x+1)+3*x-2)/(4*x))-1/2).
Showing 1-6 of 6 results.