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.

A122542 Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, 2, -1, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 2, 4, 1, 0, 2, 8, 6, 1, 0, 2, 12, 18, 8, 1, 0, 2, 16, 38, 32, 10, 1, 0, 2, 20, 66, 88, 50, 12, 1, 0, 2, 24, 102, 192, 170, 72, 14, 1, 0, 2, 28, 146, 360, 450, 292, 98, 16, 1, 0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1
Offset: 0

Views

Author

Philippe Deléham, Sep 19 2006, May 28 2007

Keywords

Comments

Riordan array (1, x*(1+x)/(1-x)). Rising and falling diagonals are the tribonacci numbers A000213, A001590.

Examples

			Triangle begins:
  1;
  0, 1;
  0, 2,  1;
  0, 2,  4,   1;
  0, 2,  8,   6,   1;
  0, 2, 12,  18,   8,    1;
  0, 2, 16,  38,  32,   10,   1;
  0, 2, 20,  66,  88,   50,  12,   1;
  0, 2, 24, 102, 192,  170,  72,  14,   1;
  0, 2, 28, 146, 360,  450, 292,  98,  16,  1;
  0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1;
		

Crossrefs

Other versions: A035607, A113413, A119800, A266213.
Sums include: A000007, A001333 (row), A001590 (diagonal), A007483, A057077 (signed row), A078016 (signed diagonal), A086901, A091928, A104934, A122558, A122690.

Programs

  • Haskell
    a122542 n k = a122542_tabl !! n !! k
    a122542_row n = a122542_tabl !! n
    a122542_tabl = map fst $ iterate
       (\(us, vs) -> (vs, zipWith (+) ([0] ++ us ++ [0]) $
                          zipWith (+) ([0] ++ vs) (vs ++ [0]))) ([1], [0, 1])
    -- Reinhard Zumkeller, Jul 20 2013, Apr 17 2013
    
  • Magma
    function T(n, k) // T = A122542
      if k eq 0 then return 0^n;
      elif k eq n then return 1;
      else return T(n-1,k) + T(n-1,k-1) + T(n-2,k-1);
      end if;
    end function;
    [T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 27 2024
  • Mathematica
    CoefficientList[#, y]& /@ CoefficientList[(1-x)/(1 - (1+y)x - y x^2) + O[x]^11, x] // Flatten (* Jean-François Alcover, Sep 09 2018 *)
    (* Second program *)
    T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, 0, T[n-1,k-1] +T[n-1,k] +T[n-2,k- 1] ]]; (* T = A122542 *)
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 27 2024 *)
  • Sage
    def A122542_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return prec(n-1,k-1)+2*sum(prec(n-i,k-1) for i in (2..n-k+1))
        return [prec(n, k) for k in (0..n)]
    for n in (0..10): print(A122542_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

Sum_{k=0..n} x^k*T(n,k) = A000007(n), A001333(n), A104934(n), A122558(n), A122690(n), A091928(n) for x = 0, 1, 2, 3, 4, 5. - Philippe Deléham, Jan 25 2012
Sum_{k=0..n} 3^(n-k)*T(n,k) = A086901(n).
Sum_{k=0..n} 2^(n-k)*T(n,k) = A007483(n-1), n >= 1. - Philippe Deléham, Oct 08 2006
T(2*n, n) = A123164(n).
T(n, k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k-1), n > 1. - Philippe Deléham, Jan 25 2012
G.f.: (1-x)/(1-(1+y)*x-y*x^2). - Philippe Deléham, Mar 02 2012
From G. C. Greubel, Oct 27 2024: (Start)
Sum_{k=0..n} (-1)^k*T(n, k) = A057077(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A001590(n+1).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = A078016(n). (End)

A319200 a(n) = -(A(n) - A(n-1)) where A(n) = A057597(n+1), for n >= 0.

Original entry on oeis.org

0, -1, 2, -1, -2, 5, -4, -3, 12, -13, -2, 27, -38, 9, 56, -103, 56, 103, -262, 215, 150, -627, 692, 85, -1404, 2011, -522, -2893, 5426, -3055, -5264, 13745, -11536, -7473, 32754, -36817, -3410, 72981, -106388, 29997, 149372, -285757, 166382, 268747, -720886, 618521, 371112, -1710519, 1957928, 123703, -3792150
Offset: 0

Views

Author

Wolfdieter Lang, Oct 23 2018

Keywords

Comments

This sequence appears in the reduction formula for negative powers of the tribonacci constant t = A058265: t^(-n) = A(n)*t^2 + a(n)*t + A(n+1)*1, with A(n) = A057597(n+1), for n >= 0. This follows from t^3 = t^2 + t + 1, or 1/t = t^2 - t - 1 = A192918, leading to the recurrence: A(n) = -A(n) - A(n-1) + A(n-2), with inputs A(-3) = 1, A(-2) = 1 and A(-1) = 0 and a(n) = -(A(n) - A(n-1)). See the example below.

Examples

			The coefficients of t^2, t, 1 for t^(-n) begin, for n >= -3:
n     t^2  t   1
-----------------
-3     1   1   1
-2     1   0   0
-1     0   1   0
----------------
+0     0   0   1
+1     1  -1  -1
+2    -1   2   0
+3     0  -1   2
+4     2  -2  -3
+5    -3   5   1
+6     1  -4   4
+7     4  -3  -8
+8    -8  12   5
+9     5 -13   7
10     7  -2 -20
...
		

Crossrefs

Cf. A057597, A058265, A078016(n+1) (different signs), A192918.

Programs

  • Mathematica
    LinearRecurrence[{-1,-1,1},{0,-1,2},60] (* Harvey P. Dale, Jul 20 2025 *)
  • PARI
    a057597(n) = polcoeff( if( n<0, x / ( 1 - x - x^2 - x^3), x^2 / ( 1 + x + x^2 - x^3) ) + x*O(x^abs(n)), abs(n)) \\ after Michael Somos in A057597
    a(n) = -(a057597(n+1)-a057597(n)) \\ Felix Fröhlich, Oct 23 2018

Formula

a(n) = -(A057597(n+1) - A057597(n)), for n >= 0.
Recurrence a(n) = -a(n-1) - a(n-2) + a(n-3), for n >=0, with a(-3) = 1, a(-2) = 0 and a(-1) = 1.
G.f.: (1 + 1/x)/(1 + x + x^2 - x^3).

A330885 Square array T(n,k) read by antidiagonals upwards: T(n,0)=1; T(n,1) = n+1; T(n,2) = 2n+1, T(n,k>2) = T(n,k-1) - T(n,k-2) - T(n,k-3).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, -1, 1, 4, 5, 0, -3, 1, 5, 7, 1, -5, -3, 1, 6, 9, 2, -7, -8, 1, 1, 7, 11, 3, -9, -13, -3, 7, 1, 8, 13, 4, -11, -18, -7, 10, 9, 1, 9, 15, 5, -13, -23, -11, 13, 21, 1, 1, 10, 17, 6, -15, -28, -15, 16, 33, 14, -15
Offset: 0

Views

Author

Bob Selcoe, May 05 2020

Keywords

Examples

			Array starts:
1  1   1  -1   -3   -3    1   7   9   1  -15   -25
1  2   3   0   -5   -8   -3  10  21  14  -17   -52
1  3   5   1   -7  -13   -7  13  33  27  -19   -79
1  4   7   2   -9  -18  -11  16  45  40  -21  -106
1  5   9   3  -11  -23  -15  19  57  53  -23  -133
1  6  11   4  -13  -28  -19  22  69  66  -25  -160
1  7  13   5  -15  -33  -23  25  81  79  -27  -187
		

Crossrefs

Columns k: A000012 (k=0), A000027 (k=1), A005408 (k=2), A023443 (k=3), A165747 (k=4), -A016885 (k=5), -A004767 (k=6), A016777 (k=7), A017629 (k=8), A190991 (k=9).

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= If[k<3, k*n+1, T[n, k-1] - T[n, k-2] - T[n, k-3]];
    Table[T[n-k, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, May 26 2020 *)

Formula

T(0,k) = A180735(k-1).
T(n,k) - T(n-1,k) = -A078016(k+1).
Showing 1-3 of 3 results.