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

A027023 Tribonacci array: triangular array T read by rows: T(n,0)=1 for n >= 0, T(n,1) = T(n,2n) = 1 for n >= 1, T(n,2)=1 for n >= 2 and for n >= 3, T(n,k) = T(n-1,k-3) + T(n-1,k-2) + T(n-1,k-1) for 3 <= k <= 2n-1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 5, 5, 1, 1, 1, 1, 3, 5, 9, 13, 11, 1, 1, 1, 1, 3, 5, 9, 17, 27, 33, 25, 1, 1, 1, 1, 3, 5, 9, 17, 31, 53, 77, 85, 59, 1, 1, 1, 1, 3, 5, 9, 17, 31, 57, 101, 161, 215, 221, 145, 1, 1, 1, 1, 3, 5, 9, 17, 31, 57, 105, 189, 319, 477, 597, 581, 367, 1
Offset: 0

Views

Author

Keywords

Comments

The n-th row has 2n+1 terms.

Examples

			The array begins:
  1;
  1, 1, 1;
  1, 1, 1, 3, 1;
  1, 1, 1, 3, 5, 5,  1;
  1, 1, 1, 3, 5, 9, 13, 11, 1;
		

Crossrefs

Columns are essentially constant with values from A000213 (tribonacci numbers).
Diagonals T(n, n+c) are A027024 (c=2), A027025 (c=3), A027026 (c=4).
Diagonals T(n, 2n-c) are A027050 (c=1), A027051 (c=2), A027027 (c=3), A027028 (c=4), A027029 (c=5), A027030 (c=6), A027031 (c=7), A027032 (c=8), A027033 (c=9), A027034 (c=10).
Many other sequences are derived from this one: see A027035 A027036 A027037 A027038 A027039 A027040 A027041 A027042 A027043 A027044 A027045 and A027046 A027047 A027048 A027049.
Other arrays of this type: A027052, A027082, A027113.
Cf. A027907.

Programs

  • GAP
    T:= function(n,k)
        if k<3 or k=2*n then return 1;
        else return T(n-1, k-3) + T(n-1, k-2) + T(n-1, k-1);
        fi;
      end;
    Flat(List([0..10], n-> List([0..2*n], k-> T(n,k) ))); # G. C. Greubel, Nov 04 2019
  • Haskell
    a027023 n k = a027023_tabf !! (n-1) !! (k-1)
    a027023_row n = a027023_tabf !! (n-1)
    a027023_tabf = [1] : iterate f [1, 1, 1] where
       f row = 1 : 1 : 1 :
               zipWith3 (((+) .) . (+)) (drop 2 row) (tail row) row ++ [1]
    -- Reinhard Zumkeller, Jul 06 2014
    
  • Maple
    T:= proc(n, k) option remember;
          if k<3 or k=2*n  then 1
        else T(n-1, k-3) + T(n-1, k-2) + T(n-1, k-1)
          fi
    end proc:
    seq(seq(T(n, k), k=0..2*n), n=0..10); # G. C. Greubel, Nov 04 2019
  • Mathematica
    T[n_, 0] := 1; T[n_, 1] := 1; T[n_, k_]/; (k==2n) := 1 /; n >=1; T[n_, 2] := 1; T[n_, k_]/; (k <= 2n-1) := T[n, k]=T[n-1, k-3]+T[n-1, k-2]+T[n-1, k-1]
  • PARI
    {T(n, k) = if( k<0 || k>2*n, 0, if( k<3 || k==2*n, 1, T(n-1, k-3) + T(n-1, k-2) + T(n-1,k-1)))}; /* Michael Somos, Feb 14 2004 */
    
  • Sage
    def T(n, k):
        if (k<3 or k==2*n): return 1
        else: return T(n-1, k-3) + T(n-1, k-2) + T(n-1, k-1)
    [[T(n, k) for k in (0..2*n)] for n in (0..10)] # G. C. Greubel, Nov 04 2019
    

Extensions

Edited by N. J. A. Sloane and Ralf Stephan, Feb 13 2004
Offset corrected to 0. - R. J. Mathar, Jun 24 2020

A027053 a(n) = T(n,n+2), T given by A027052.

Original entry on oeis.org

1, 4, 9, 18, 35, 66, 123, 228, 421, 776, 1429, 2630, 4839, 8902, 16375, 30120, 55401, 101900, 187425, 344730, 634059, 1166218, 2145011, 3945292, 7256525, 13346832, 24548653, 45152014, 83047503, 152748174, 280947695, 516743376
Offset: 2

Views

Author

Keywords

Comments

Second differences of (A027026(n)-1)/2.
Pairwise sums of A089068.
a(n) is also the number of fixed polyominoes with n cells of height (or width) 2. - David Bevan, Sep 09 2009

Crossrefs

2nd column of A308359.

Programs

  • GAP
    a:=[1,4,9,18];; for n in [5..30] do a[n]:=2*a[n-1]-a[n-4]; od; a; # G. C. Greubel, Nov 05 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 32); Coefficients(R!( x^2*(1+x)^2/((1-x)*(1-x-x^2-x^3)) )); // G. C. Greubel, Nov 05 2019
    
  • Maple
    seq(coeff(series(x^2*(1+x)^2/((1-x)*(1-x-x^2-x^3)), x, n+1), x, n), n = 2 ..30); # G. C. Greubel, Nov 05 2019
  • Mathematica
    LinearRecurrence[{2,0,0,-1}, {1,4,9,18}, 30] (* G. C. Greubel, Nov 05 2019 *)
  • PARI
    my(x='x+O('x^32)); Vec(x^2*(1+x)^2/((1-x)*(1-x-x^2-x^3))) \\ G. C. Greubel, Nov 05 2019
    
  • Sage
    def A027053_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P(x^2*(1+x)^2/((1-x)*(1-x-x^2-x^3))).list()
    a=A027053_list(32); a[2:] # G. C. Greubel, Nov 05 2019
    

Formula

G.f.: x^2*(1+x)^2/((1-x)*(1-x-x^2-x^3)).
a(n) = A089068(n-1) + A089068(n).
a(n) = a(n-1) + a(n-2) + a(n-3) + 4. - David Bevan, Sep 09 2009
a(n) = A001590(n+3) - 2. - David Bevan, Sep 09 2009
a(n+1) - a(n) = A000213(n+1). - R. J. Mathar, Aug 04 2013

A027086 a(n) = A027082(n, n+4).

Original entry on oeis.org

11, 41, 108, 246, 517, 1035, 2010, 3828, 7199, 13429, 24920, 46090, 85065, 156791, 288758, 531528, 978099, 1799521, 3310404, 6089406, 11200845, 20602307, 37894354, 69699452, 128198215, 235794285, 433694384, 797689490, 1467180945, 2698567791, 4963441390
Offset: 4

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    I:=[11,41,108,246,517,1035]; [n le 6 select I[n] else 4*Self(n-1)-5*Self(n-2)+2*Self(n-3)-Self(n-4)+2*Self(n-5)-Self(n-6): n in [1..40]]; // Vincenzo Librandi, Feb 20 2016
  • Mathematica
    LinearRecurrence[{4, -5, 2, -1, 2, -1}, {11, 41, 108, 246, 517, 1035}, 35] (* Vincenzo Librandi, Feb 20 2016 *)
  • PARI
    Vec(x^4*(11-3*x-x^2-3*x^3+2*x^4)/((1-x)^3*(1-x-x^2-x^3)) + O(x^40)) \\ Colin Barker, Feb 20 2016
    

Formula

a(n) = A027026(n) + (n+1)(n+2)/2 - 3.
From Colin Barker, Feb 20 2016: (Start)
a(n) = 4*a(n-1)-5*a(n-2)+2*a(n-3)-a(n-4)+2*a(n-5)-a(n-6) for n>9.
G.f.: x^4*(11-3*x-x^2-3*x^3+2*x^4) / ((1-x)^3*(1-x-x^2-x^3)).
(End)
a(n) = A000213(n+4) -4 -3*n*(n+3)/2. - R. J. Mathar, Jun 24 2020
Showing 1-3 of 3 results.