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

A084608 Triangle, read by rows, where the n-th row lists the (2n+1) coefficients of (1+2*x+3*x^2)^n.

Original entry on oeis.org

1, 1, 2, 3, 1, 4, 10, 12, 9, 1, 6, 21, 44, 63, 54, 27, 1, 8, 36, 104, 214, 312, 324, 216, 81, 1, 10, 55, 200, 530, 1052, 1590, 1800, 1485, 810, 243, 1, 12, 78, 340, 1095, 2712, 5284, 8136, 9855, 9180, 6318, 2916, 729, 1, 14, 105, 532, 2009, 5922, 13993, 26840, 41979
Offset: 0

Views

Author

Paul D. Hanna, Jun 01 2003

Keywords

Examples

			Triangle begins:
  1;
  1,  2,  3;
  1,  4, 10,  12,   9;
  1,  6, 21,  44,  63,   54,   27;
  1,  8, 36, 104, 214,  312,  324,  216,   81;
  1, 10, 55, 200, 530, 1052, 1590, 1800, 1485, 810, 243;
		

Crossrefs

Programs

  • Haskell
    a084608 n = a084608_list !! n
    a084608_list = concat $ iterate ([1,2,3] *) [1]
    instance Num a => Num [a] where
       fromInteger k = [fromInteger k]
       (p:ps) + (q:qs) = p + q : ps + qs
       ps + qs         = ps ++ qs
       (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
        *                = []
    -- Reinhard Zumkeller, Apr 02 2011
    
  • Magma
    A084608:= func< n,k | (&+[Binomial(n, k-j)*Binomial(k-j, j)*2^(k-2*j)*3^j: j in [0..k]]) >;
    [A084608(n,k): k in [0..2*n], n in [0..13]]; // G. C. Greubel, Mar 27 2023
    
  • Maple
    f:= proc(n) option remember; expand((1+2*x+3*x^2)^n) end:
    T:= (n,k)-> coeff(f(n), x, k):
    seq(seq(T(n, k), k=0..2*n), n=0..10);  # Alois P. Heinz, Apr 03 2011
  • Mathematica
    row[n_] := (1+2x+3x^2)^n + O[x]^(2n+1) // CoefficientList[#, x]&; Table[row[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Feb 01 2017 *)
  • PARI
    for(n=0,10, for(k=0,2*n,t=polcoeff((1+2*x+3*x^2)^n,k,x); print1(t",")); print(" "))
    
  • SageMath
    def A084608(n,k): return sum(binomial(n,j)*binomial(n-j,k-2*j)*2^(k-2*j)*3^j for j in range(k//2+1))
    flatten([[A084608(n,k) for k in range(2*n+1)] for n in range(14)]) # G. C. Greubel, Mar 27 2023

Formula

From G. C. Greubel, Mar 27 2023: (Start)
T(n, k) = Sum_{j=0..k} binomial(n, k-j)*binomial(k-j, j)*2^(k-2*j)*3^j.
T(n, n) = A084609(n).
T(n, 2*n-1) = A212697(n), n >= 1.
T(n, 2*n) = A000244(n).
Sum_{j=0..2*n} T(n, k) = A000400(n).
Sum_{k=0..2*n} (-1)^k*T(n, k) = A000079(n).
Sum_{k=0..n} T(n-k, k) = A101822(n). (End)

A380886 Triangle T(n,k), 1<=k<=n: column k are the coefficients of the INVERT transform of Sum_{i=1..k} i*x^i.

Original entry on oeis.org

1, 1, 3, 1, 5, 8, 1, 11, 17, 21, 1, 21, 42, 50, 55, 1, 43, 100, 128, 138, 144, 1, 85, 235, 323, 358, 370, 377, 1, 171, 561, 813, 923, 965, 979, 987, 1, 341, 1331, 2043, 2378, 2510, 2559, 2575, 2584, 1, 683, 3158, 5150, 6125, 6527, 6681, 6737, 6755, 6765, 1, 1365, 7503, 12967, 15772, 16972, 17441, 17617, 17680, 17700, 17711
Offset: 1

Views

Author

R. J. Mathar, Feb 07 2025

Keywords

Examples

			The full array starts
  1    1    1    1    1    1    1    1    1    1
  1    3    3    3    3    3    3    3    3    3
  1    5    8    8    8    8    8    8    8    8
  1   11   17   21   21   21   21   21   21   21
  1   21   42   50   55   55   55   55   55   55
  1   43  100  128  138  144  144  144  144  144
  1   85  235  323  358  370  377  377  377  377
  1  171  561  813  923  965  979  987  987  987
  1  341 1331 2043 2378 2510 2559 2575 2584 2584
  1  683 3158 5150 6125 6527 6681 6737 6755 6765
but the non-interesting upper right triangular part is not put into the sequence.
		

Crossrefs

Cf. A001045 (column k=2), A101822 (column k=3), A322059 (column k=4?), A001906 (diagonal), A054452 (subdiagonal).

Programs

  • Maple
    A380886 := proc(n,k)
        local g,x ;
        g := 1/(1-add(i*x^i,i=1..k)) ;
        coeftayl(g,x=0,n) ;
    end proc:
    seq(seq( A380886(n,k),k=1..n),n=1..12) ;

Formula

T(n,k) = [x^n] 1/(1-x^1-2*x^2-3*x^3-4*x^4-...-k*x^k) .

A100550 a(n) = a(n-1) + 2*a(n-2) + 3*a(n-3), for n>3, otherwise a(n) = n.

Original entry on oeis.org

0, 1, 2, 4, 11, 25, 59, 142, 335, 796, 1892, 4489, 10661, 25315, 60104, 142717, 338870, 804616, 1910507, 4536349, 10771211, 25575430, 60726899, 144191392, 342371480, 812934961, 1930252097, 4583236459, 10882545536, 25839774745, 61354575194
Offset: 0

Views

Author

gamo (gamo(AT)telecable.es), Nov 27 2004

Keywords

Comments

A recursive and iterative algorithm for the computation of a(n) appear as Exercise 1.11 in the book Structure and Interpretation of Computer Programs. - Bas Kok (no(AT)spam.com), Jan 31 2008

References

  • Harold Abelson and Gerald Jay Sussman with Julie Sussman, Structure and Interpretation of Computer Programs, MIT Press, 1996.

Crossrefs

Programs

  • Magma
    [n le 3 select n-1 else Self(n-1) +2*Self(n-2) +3*Self(n-3): n in [1..41]]; // G. C. Greubel, Mar 27 2023
    
  • Mathematica
    LinearRecurrence[{1,2,3},{0,1,2},40] (* Harvey P. Dale, Mar 19 2023 *)
  • Perl
    perl -e '@a=(0,1,2);for(3..30){$a[$]=$a[$-1]+2*$a[$-2]+3*$a[$-3];} print "@a ";'
    
  • SageMath
    @CachedFunction
    def a(n): # a = A100550
        if (n<3): return n
        else: return a(n-1) + 2*a(n-2) + 3*a(n-3)
    [a(n) for n in range(41)] # G. C. Greubel, Mar 27 2023

Formula

From R. J. Mathar, Aug 22 2008: (Start)
O.g.f.: x*(1+x)/(1-x-2*x^2-3*x^3).
a(n) = A101822(n-1) + A101822(n-2). (End)

A213947 Triangle read by rows: columns are finite differences of the INVERT transform of (1, 2, 3, ...) terms.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 1, 10, 6, 4, 1, 20, 21, 8, 5, 1, 42, 57, 28, 10, 6, 1, 84, 150, 88, 35, 12, 7, 1, 170, 390, 252, 110, 42, 14, 8, 1, 340, 990, 712, 335, 132, 49, 16, 9, 1, 682, 2475, 1992, 975, 402, 154, 56, 18, 10
Offset: 1

Views

Author

Gary W. Adamson, Jun 25 2012

Keywords

Comments

Create an array in which the n-th row is the output of the INVERT transform on the first n natural numbers followed by zeros:
1, 1, 1, 1, 1, 1, 1, ...
1, 3, 5, 11, 21, 43, 85, ... (A001045)
1, 3, 8, 17, 42, 100, 235, ... (A101822)
1, 3, 8, 21, 50, 128, 323, ...
...
For example, row 3 is the INVERT transform of (1, 2, 3, 0, 0, 0, ...). Then, take finite differences of column terms starting from the top; which become the rows of the triangle.

Examples

			First few rows of the triangle:
  1;
  1,    2;
  1,    4,    3;
  1,   10,    6,    4;
  1,   20,   21,    8,    5;
  1,   42,   57,   28,   10,    6;
  1,   84,  150,   88,   35,   12,   7;
  1,  170,  390,  252,  110,   42,  14,   8;
  1,  340,  990,  712,  335,  132,  49,  16,  9;
  1,  682, 2475, 1992,  975,  402, 154,  56, 18, 10;
  1, 1364, 6138, 5464, 2805, 1200, 469, 176, 63, 20, 11;
  ...
		

Crossrefs

Cf. A001906 (row sums), A026644 (2nd column).

Programs

  • Maple
    read("transforms") ;
    A213947i := proc(n,k)
            L := [seq(i,i=1..n),seq(0,i=0..k)] ;
            INVERT(L) ;
            op(k,%) ;
    end proc:
    A213947 := proc(n,k)
            if k = 1 then
                    1;
            else
            A213947i(k,n)-A213947i(k-1,n) ;
            end if;
    end proc: # R. J. Mathar, Jun 30 2012

A366942 Expansion of e.g.f. 1/(1-x-2*x^2-3*x^3).

Original entry on oeis.org

1, 1, 6, 48, 408, 5040, 72000, 1184400, 22619520, 482993280, 11459750400, 299495750400, 8531976499200, 263353163673600, 8754879893760000, 311808414677760000, 11845876873678848000, 478163414336864256000, 20436460099541950464000, 921972301728418676736000
Offset: 0

Views

Author

Enrique Navarrete, Oct 29 2023

Keywords

Comments

a(n) is the number of ways to partition [n] into blocks of size at most 3, order the blocks, order the elements within each block, and choose 1 element from each block.
E.g.: a(4) = 408 since we have the following cases:
1,2,3,4: 24 such orderings, 1 way to choose one element from each block;
12,34: 24 such orderings, 2*2 ways to choose one element from each block;
12,3,4: 72 such orderings, 2*1*1 ways to choose one element from each block;
123,4: 48 such orderings, 3*1 ways to choose one element from each block;
so 24*1 + 24*4 + 72*2 + 48*3 = 408 ways.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add(
          a(n-j)*binomial(n, j)*j!*j, j=1..min(3, n)))
        end:
    seq(a(n), n=0..19);  # Alois P. Heinz, Dec 14 2023
  • Mathematica
    With[{m = 20}, Range[0, m]! * CoefficientList[Series[1/(1 - x - 2*x^2 - 3*x^3), {x, 0, m}], x]] (* Amiram Eldar, Oct 30 2023 *)
  • PARI
    my(x='x+O('x^25)); Vec(serlaplace(1/(1-x-2*x^2-3*x^3))) \\ Michel Marcus, Oct 30 2023

Formula

a(n) = A000142(n)*A101822(n).
a(n) = n*(a(n-1)+(n-1)*(2*a(n-2)+(n-2)*3*a(n-3))) for n>=3. - Alois P. Heinz, Dec 14 2023
Showing 1-5 of 5 results.