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

A375025 Triangle read by rows: Matrix inverse of row-reversed A374439.

Original entry on oeis.org

1, -2, 1, 3, -2, 1, -4, 2, -2, 1, 6, -2, 1, -2, 1, -10, 5, 0, 0, -2, 1, 15, -10, 5, 2, -1, -2, 1, -20, 10, -12, 6, 4, -2, -2, 1, 30, -8, 4, -16, 8, 6, -3, -2, 1, -52, 26, 8, -4, -22, 11, 8, -4, -2, 1, 78, -60, 30, 30, -15, -30, 15, 10, -5, -2, 1
Offset: 0

Views

Author

Peter Luschny, Aug 07 2024

Keywords

Examples

			Triangle starts:
  [0] [  1]
  [1] [ -2,   1]
  [2] [  3,  -2,   1]
  [3] [ -4,   2,  -2,   1]
  [4] [  6,  -2,   1,  -2,   1]
  [5] [-10,   5,   0,   0,  -2,  1]
  [6] [ 15, -10,   5,   2,  -1, -2,  1]
  [7] [-20,  10, -12,   6,   4, -2, -2,  1]
  [8] [ 30,  -8,   4, -16,   8,  6, -3, -2,  1]
  [9] [-52,  26,   8,  -4, -22, 11,  8, -4, -2, 1]
		

Crossrefs

Column 0 and row sums: A086990, A090412; alternating row sums: A375026.
Cf. A374439.

Programs

  • Maple
    A := (n,k) -> ifelse(k::odd,2,1)*binomial(n-irem(k,2)-iquo(k,2),iquo(k,2)):
    ARevRow := n -> local k; [seq(A(n, n-k), k = 0..n)]:
    M := m -> Matrix(m, (n, k) -> ifelse(k > n, 0, ARevRow(n-1)[k])):
    T := n -> LinearAlgebra:-MatrixInverse(M(n)): T(11);
  • Python
    from functools import cache
    @cache
    def Trow(n):
        if n == 0: return [1]
        if n == 1: return [-2, 1]
        fli = Trow(n - 1)
        row = [1] * (n + 1)
        row[n - 1] = -2
        for k in range(n - 2, 0, -1):
            row[k] = fli[k - 1] - fli[k + 1]
        row[0] = -2 * fli[0] - fli[1]
        return row
    # Peter Luschny, Aug 18 2024

A001077 Numerators of continued fraction convergents to sqrt(5).

Original entry on oeis.org

1, 2, 9, 38, 161, 682, 2889, 12238, 51841, 219602, 930249, 3940598, 16692641, 70711162, 299537289, 1268860318, 5374978561, 22768774562, 96450076809, 408569081798, 1730726404001, 7331474697802, 31056625195209
Offset: 0

Views

Author

Keywords

Comments

a(2*n+1) with b(2*n+1) := A001076(2*n+1), n >= 0, give all (positive integer) solutions to Pell equation a^2 - 5*b^2 = -1.
a(2*n) with b(2*n) := A001076(2*n), n >= 1, give all (positive integer) solutions to Pell equation a^2 - 5*b^2 = +1 (see Emerson reference).
Bisection: a(2*n) = T(n,9) = A023039(n), n >= 0 and a(2*n+1) = 2*S(2*n, 2*sqrt(5)) = A075796(n+1), n >= 0, with T(n,x), resp. S(n,x), Chebyshev's polynomials of the first, resp. second kind. See A053120, resp. A049310.
From Greg Dresden, May 21 2023: (Start)
For n >= 2, 8*a(n) is the number of ways to tile this T-shaped figure of length n-1 with four colors of squares and one color of domino; shown here is the figure of length 5 (corresponding to n=6), and it has 8*a(6) = 23112 different tilings.
_
|| _
|||_|||
|_|
(End)

Examples

			1  2  9  38  161  (A001077)
-, -, -, --, ---, ...
0  1  4  17   72  (A001076)
1 + 2*x + 9*x^2 + 38*x^3 + 161*x^4 + 682*x^5 + 2889*x^6 + 12238*x^7 + ... - _Michael Somos_, Aug 11 2009
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • V. Thébault, Les Récréations Mathématiques, Gauthier-Villars, Paris, 1952, p. 282.

Crossrefs

Programs

  • Magma
    I:=[1, 2]; [n le 2 select I[n] else 4*Self(n-1) + Self(n-2): n in [1..30]]; // G. C. Greubel, Dec 19 2017
  • Maple
    A001077:=(-1+2*z)/(-1+4*z+z**2); # conjectured by Simon Plouffe in his 1992 dissertation
    with(combinat): a:=n->fibonacci(n+1, 4)-2*fibonacci(n, 4): seq(a(n), n=0..30); # Zerinvary Lajos, Apr 04 2008
  • Mathematica
    LinearRecurrence[{4, 1}, {1, 2}, 30]
    Join[{1},Numerator[Convergents[Sqrt[5],30]]] (* Harvey P. Dale, Mar 23 2016 *)
    CoefficientList[Series[(1-2*x)/(1-4*x-x^2), {x, 0, 30}], x] (* G. C. Greubel, Dec 19 2017 *)
    LucasL[3*Range[0,30]]/2 (* Rigoberto Florez, Apr 03 2019 *)
    a[ n_] := LucasL[n, 4]/2; (* Michael Somos, Nov 02 2021 *)
  • PARI
    {a(n) = fibonacci(3*n) / 2 + fibonacci(3*n - 1)}; /* Michael Somos, Aug 11 2009 */
    
  • PARI
    a(n)=if(n<2,n+1,my(t=4);for(i=1,n-2,t=4+1/t);numerator(2+1/t)) \\ Charles R Greathouse IV, Dec 05 2011
    
  • PARI
    x='x+O('x^30); Vec((1-2*x)/(1-4*x-x^2)) \\ G. C. Greubel, Dec 19 2017
    
  • Sage
    [lucas_number2(n,4,-1)/2 for n in range(0, 30)] # Zerinvary Lajos, May 14 2009
    

Formula

G.f.: (1-2*x)/(1-4*x-x^2).
a(n) = 4*a(n-1) + a(n-2), a(0)=1, a(1)=2.
a(n) = ((2 + sqrt(5))^n + (2 - sqrt(5))^n)/2.
a(n) = A014448(n)/2.
Limit_{n->infinity} a(n)/a(n-1) = phi^3 = 2 + sqrt(5). - Gregory V. Richardson, Oct 13 2002
a(n) = ((-i)^n)*T(n, 2*i), with T(n, x) Chebyshev's polynomials of the first kind A053120 and i^2 = -1.
Binomial transform of A084057. - Paul Barry, May 10 2003
E.g.f.: exp(2x)cosh(sqrt(5)x). - Paul Barry, May 10 2003
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)*5^k*2^(n-2k). - Paul Barry, Nov 15 2003
a(n) = 4*a(n-1) + a(n-2) when n > 2; a(1) = 1, a(2) = 2. - Alex Vinokur (alexvn(AT)barak-online.net), Oct 25 2004
a(n) = A001076(n+1) - 2*A001076(n) = A097924(n) - A015448(n+1); a(n+1) = A097924(n) + 2*A001076(n) = A097924(n) + 2(A048876(n) - A048875(n)). - Creighton Dement, Mar 19 2005
a(n) = F(3*n)/2 + F(3*n-1) where F() = Fibonacci numbers A000045. - Gerald McGarvey, Apr 28 2007
a(n) = A000032(3*n)/2.
For n >= 1: a(n) = (1/2)*Fibonacci(6*n)/Fibonacci(3*n) and a(n) = integer part of (2 + sqrt(5))^n. - Artur Jasinski, Nov 28 2011
a(n) = Sum_{k=0..n} A201730(n,k)*4^k. - Philippe Deléham, Dec 06 2011
a(n) = A001076(n) + A015448(n). - R. J. Mathar, Jul 06 2012
G.f.: G(0)/2, where G(k) = 1 + 1/(1 - x*(5*k-4)/(x*(5*k+1) - 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 27 2013
a(n) is the (1,1)-entry of the matrix W^n with W=[2, sqrt(5); sqrt(5), 2]. - Carmine Suriano, Mar 21 2014
From Rigoberto Florez, Apr 03 2019: (Start)
a(n) = A099919(n) + A049651(n) if n > 0.
a(n) = 1 + Sum_{k=0..n-1} L(3*k + 1) if n >= 0, L(n) = n-th Lucas number (A000032). (End)
From Christopher Hohl, Aug 22 2021: (Start)
For n >= 2, a(2n-1) = A079962(6n-9) + A079962(6n-3).
For n >= 1, a(2n) = sqrt(20*A079962(6n-3)^2 + 1). (End)
a(n) = Sum_{k=0..n-2} A168561(n-2,k)*4^k + 2 * Sum_{k=0..n-1} A168561(n-1,k)*4^k, n>0. - R. J. Mathar, Feb 14 2024
a(n) = 4^n*Sum_{k=0..n} A374439(n, k)*(-1/4)^k. - Peter Luschny, Jul 26 2024
From Peter Bala, Jul 08 2025: (Start)
The following series telescope:
Sum_{n >= 1} 1/(a(n) + 5*(-1)^(n+1)/a(n)) = 3/8, since 1/(a(n) + 5*(-1)^(n+1)/a(n)) = b(n) - b(n+1), where b(n) = (1/4) * (a(n) + a(n-1)) / (a(n)*a(n-1)).
Sum_{n >= 1} (-1)^(n+1)/(a(n) + 5*(-1)^(n+1)/a(n)) = 1/8, since 1/(a(n) + 5*(-1)^(n+1)/a(n)) = c(n) + c(n+1), where c(n) = (1/4) * (a(n) - a(n-1)) / (a(n)*a(n-1)). (End)

Extensions

Chebyshev comments from Wolfdieter Lang, Jan 10 2003

A003688 a(n) = 3*a(n-1) + a(n-2), with a(1)=1 and a(2)=4.

Original entry on oeis.org

1, 4, 13, 43, 142, 469, 1549, 5116, 16897, 55807, 184318, 608761, 2010601, 6640564, 21932293, 72437443, 239244622, 790171309, 2609758549, 8619446956, 28468099417, 94023745207, 310539335038, 1025641750321, 3387464586001, 11188035508324, 36951571110973
Offset: 1

Views

Author

Keywords

Comments

Number of 2-factors in K_3 X P_n.
Form the graph with matrix [1,1,1,1;1,1,1,0;1,1,0,1;1,0,1,1]. The sequence 1,1,4,13,... with g.f. (1-2*x)/(1-3*x-x^2) counts closed walks of length n at the vertex of degree 5. - Paul Barry, Oct 02 2004
a(n) is term (1,1) in M^n, where M is the 3x3 matrix [1,1,2; 1,1,1; 1,1,1]. - Gary W. Adamson, Mar 12 2009
Starting with 1, INVERT transform of A003945: (1, 3, 6, 12, 24, ...). - Gary W. Adamson, Aug 05 2010
Row sums of triangle
m/k.|..0.....1.....2.....3.....4.....5.....6.....7
==================================================
.0..|..1
.1..|..1.....3
.2..|..1.....3.....9
.3..|..1.....6.....9.....27
.4..|..1.....6....27.....27...81
.5..|..1.....9....27....108...81...243
.6..|..1.....9....54....108..405...243...729
.7..|..1....12....54....270..405..1458...729..2187
which is the triangle for numbers 3^k*C(m,k) with duplicated diagonals. - Vladimir Shevelev, Apr 12 2012
Pisano period lengths: 1, 3, 1, 6, 12, 3, 16, 12, 6, 12, 8, 6, 52, 48, 12, 24, 16, 6, 40, 12, ... - R. J. Mathar, Aug 10 2012
a(n-1) is the number of length-n strings of 4 letters {0,1,2,3} with no two adjacent nonzero letters identical. The general case (strings of L letters) is the sequence with g.f. (1+x)/(1-(L-1)*x-x^2). - Joerg Arndt, Oct 11 2012

Examples

			G.f. = x + 4*x^2 + 13*x^3 + 43*x^4 + 142*x^5 + 469*x^6 + 1549*x^7 + 5116*x^8 + ...
		

References

  • F. Faase, On the number of specific spanning subgraphs of the graphs G X P_n, Ars Combin. 49 (1998), 129-154.

Crossrefs

Partial sums of A052906. Pairwise sums of A006190.
Cf. A374439.

Programs

  • Magma
    [n le 2 select 4^(n-1) else 3*Self(n-1)+Self(n-2): n in [1..30]]; // Vincenzo Librandi, Aug 19 2011
    
  • Maple
    with(combinat): a:=n->fibonacci(n,3)-2*fibonacci(n-1,3): seq(a(n), n=2..25); # Zerinvary Lajos, Apr 04 2008
  • Mathematica
    a[n_] := (MatrixPower[{{1, 3}, {1, 2}}, n].{{1}, {1}})[[1, 1]]; Table[ a[n], {n, 0, 23}] (* Robert G. Wilson v, Jan 13 2005 *)
    LinearRecurrence[{3,1},{1,4},30] (* Harvey P. Dale, Mar 15 2015 *)
  • PARI
    a(n)=([0,1; 1,3]^(n-1)*[1;4])[1,1] \\ Charles R Greathouse IV, Aug 14 2017
    
  • SageMath
    @CachedFunction
    def a(n): # a = A003688
        if (n<3): return 4^(n-1)
        else: return 3*a(n-1) + a(n-2)
    [a(n) for n in range(1,41)] # G. C. Greubel, Dec 26 2023

Formula

a(n) = ((13 - sqrt(13))/26)*((3 + sqrt(13))/2)^n + ((13 + sqrt(13))/26)*((3 - sqrt(13))/2)^n. - Paul Barry, Oct 02 2004
a(n) = Sum_{k=0..n} 2^k*A055830(n,k). - Philippe Deléham, Oct 18 2006
Starting (1, 1, 4, 13, 43, 142, 469, ...), row sums (unsigned) of triangle A136159. - Gary W. Adamson, Dec 16 2007
G.f.: x*(1+x)/(1-3*x-x^2). - Philippe Deléham, Nov 03 2008
a(n) = A006190(n) + A006190(n-1). - Sergio Falcon, Nov 26 2009
For n>=2, a(n) = F_n(3) + F_(n+1)(3), where F_n(x) is Fibonacci polynomial (cf. A049310): F_n(x) = Sum_{i=0..floor((n-1)/2)} binomial(n-i-1,i) * x^(n-2*i-1). - Vladimir Shevelev, Apr 13 2012
G.f.: G(0)*(1+x)/(2-3*x), where G(k) = 1 + 1/(1 - (x*(13*k-9))/( x*(13*k+4) - 6/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 15 2013
a(n)^2 is the denominator of continued fraction [3,3,...,3, 5, 3,3,...,3], which has n-1 3's before, and n-1 3's after, the middle 5. - Greg Dresden, Sep 18 2019
a(n) = Sum_{k=0..n} A046854(n-1,k)*3^k. - R. J. Mathar, Feb 10 2024
a(n) = 3^n*Sum_{k=0..n} A374439(n, k)*(-1/3)^k. - Peter Luschny, Jul 26 2024

Extensions

Formula added by Olivier Gérard, Aug 15 1997
Name clarified by Michel Marcus, Oct 16 2016

A048875 Generalized Pellian with second term of 6.

Original entry on oeis.org

1, 6, 25, 106, 449, 1902, 8057, 34130, 144577, 612438, 2594329, 10989754, 46553345, 197203134, 835365881, 3538666658, 14990032513, 63498796710, 268985219353, 1139439674122, 4826743915841, 20446415337486, 86612405265785, 366896036400626, 1554196550868289
Offset: 0

Views

Author

Keywords

Examples

			G.f. = 1 + 6*x + 25*x^2 + 106*x^3 + 449*x^4 + 1902*x^5 + 8057*x^6 + 34130*x^7 + ...
		

Crossrefs

Programs

  • Maple
    with(combinat): a:=n->2*fibonacci(n-1,4)+fibonacci(n,4): seq(a(n), n=1..17); # Zerinvary Lajos, Apr 04 2008
  • Mathematica
    LinearRecurrence[{4,1},{1,6},40] (* Harvey P. Dale, Nov 30 2011 *)
    a[ n_] := (4 I ChebyshevT[ n + 1, -2 I] - 3 ChebyshevT[ n, -2 I]) I^n / 5; (* Michael Somos, Feb 23 2014 *)
    a[ n_] := If[ n < 0, SeriesCoefficient[ (1 + 6 x) / (1 + 4 x - x^2), {x, 0, -n}], SeriesCoefficient[ (1 + 2 x) / (1 - 4 x - x^2), {x, 0, n}]]; (* Michael Somos, Feb 23 2014 *)
  • Maxima
    a[0]:1$ a[1]:6$ a[n]:=4*a[n-1]+a[n-2]$ makelist(a[n], n, 0, 30); /* Martin Ettl, Nov 03 2012 */
    
  • PARI
    {a(n) = ( 4*I*polchebyshev( n+1, 1, -2*I) - 3*polchebyshev( n, 1, -2*I)) * I^n / 5}; /* Michael Somos, Feb 23 2014 */
    
  • PARI
    {a(n) = if( n<0, polcoeff( (1 + 6*x) / (1 + 4*x - x^2) + x * O(x^-n), -n), polcoeff( (1 + 2*x) / (1 - 4*x - x^2) + x * O(x^n), n))}; \\ Michael Somos, Feb 23 2014

Formula

a(n) = ((4+sqrt(5))*(2+sqrt(5))^n - (4-sqrt(5))*(2-sqrt(5))^n)*sqrt(5)/2.
a(n) = 4a(n-1) + a(n-2); a(0)=1, a(1)=6.
Binomial transform of A134418: (1, 5, 14, 48, 152, ...). - Gary W. Adamson, Nov 23 2007
G.f.: (1+2*x)/(1-4*x-x^2). - Philippe Deléham, Nov 03 2008
a(-1 - n) = (-1)^n * A097924(n) for all n in Z. - Michael Somos, Feb 23 2014
a(n) = A001076(n+1) + 2*A001076(n). - R. J. Mathar, Sep 11 2019
a(n) = 4^n*Sum_{k=0..n} A374439(n, k)*(1/4)^k. - Peter Luschny, Jul 26 2024

Extensions

Corrected by T. D. Noe, Nov 07 2006

A108300 a(n+2) = 3*a(n+1) + a(n), with a(0) = 1, a(1) = 5.

Original entry on oeis.org

1, 5, 16, 53, 175, 578, 1909, 6305, 20824, 68777, 227155, 750242, 2477881, 8183885, 27029536, 89272493, 294847015, 973813538, 3216287629, 10622676425, 35084316904, 115875627137, 382711198315, 1264009222082, 4174738864561, 13788225815765, 45539416311856
Offset: 0

Views

Author

Creighton Dement, Jul 24 2005

Keywords

Comments

Binomial transform is A109114.
Invert transform is A109115.
Inverse invert transform is A016777.
Inverse binomial transform is A006130.

Crossrefs

Row sums and main diagonal of A143972. - Gary W. Adamson, Sep 06 2008

Programs

  • Maple
    seriestolist(series((-2*x-1)/(x^2-1+3*x), x=0,25));
  • Mathematica
    LinearRecurrence[{3,1},{1,5},40] (* Harvey P. Dale, Jul 04 2013 *)
  • PARI
    Vec((1 + 2*x)/(1 - 3*x - x^2) + O(x^30)) \\ Andrew Howroyd, Jun 05 2021

Formula

G.f.: (1 + 2*x)/(1 - 3*x - x^2).
a(n) = A052924(n+1) - A052924(n).
a(n)*a(n-2) = a(n-1)^2 + 9*(-1)^n. - Roger L. Bagula, May 17 2010
a(n) = 3^n*Sum_{k=0..n} A374439(n, k)*(1/3)^k. - Peter Luschny, Jul 26 2024

A124038 Triangle read by rows: T(n, k) = T(n-1, k-1) - T(n-2, k), with T(n, n) = 1, T(n, n-1) = -2.

Original entry on oeis.org

1, -2, 1, -1, -2, 1, 2, -2, -2, 1, 1, 4, -3, -2, 1, -2, 3, 6, -4, -2, 1, -1, -6, 6, 8, -5, -2, 1, 2, -4, -12, 10, 10, -6, -2, 1, 1, 8, -10, -20, 15, 12, -7, -2, 1, -2, 5, 20, -20, -30, 21, 14, -8, -2, 1, -1, -10, 15, 40, -35, -42, 28, 16, -9, -2, 1
Offset: 0

Views

Author

Gary W. Adamson and Roger L. Bagula, Nov 03 2006

Keywords

Examples

			Triangular sequence begins as:
   1;
  -2,   1;
  -1,  -2,   1;
   2,  -2,  -2,   1;
   1,   4,  -3,  -2,   1;
  -2,   3,   6,  -4,  -2,   1;
  -1,  -6,   6,   8,  -5,  -2,  1;
   2,  -4, -12,  10,  10,  -6, -2,  1;
   1,   8, -10, -20,  15,  12, -7, -2,  1;
  -2,   5,  20, -20, -30,  21, 14, -8, -2,  1;
  -1, -10,  15,  40, -35, -42, 28, 16, -9, -2, 1;
		

Crossrefs

Row reversal of: A374439.
Columns are related to: A000034 (k=0), A029578 (k=1), A131259 (k=2).
Diagonals are related to: A113679 (k=n-1), A022958 (k=n-2), A005843 (k=n-3), A000217 (k=n-4), -A002378 (k=n-5).
Sums include: (-1)^floor((n+1)/2)*A016116 (signed diagonal), A057079 (row), A119910 (signed row), (-1)^n*A130706 (diagonal).

Programs

  • Magma
    function T(n,k) // T = A124038
      if k lt 0 or k gt n then return 0;
      elif k ge n-2 then return k-n + (-1)^(n+k);
      else return T(n-1,k-1) - T(n-2,k);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 22 2025
  • Mathematica
    (* First program *)
    t[n_, m_, d_]:= If[n==m && n>1 && m>1, x, If[n==m-1 || n==m+1, -1, If[n==m== 1, x-2, 0]]];
    M[d_]:= Table[t[n,m,d], {n,d}, {m,d}];
    Join[{{1}}, Table[CoefficientList[Table[Det[M[d]], {d,10}][[d]], x], {d,10}]]//Flatten
    (* Second program *)
    T[n_, k_]:= T[n, k] = If[k<0 || k>n, 0, If[k>n-2, k-n+(-1)^(n-k), T[n-1, k- 1] -T[n-2,k]]];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 22 2025 *)
  • SageMath
    @CachedFunction
    def A124038(n,k):
        if n< 0: return 0
        if n==0: return 1 if k == 0 else 0
        h = 2*A124038(n-1,k) if n==1 else 0
        return A124038(n-1,k-1) - A124038(n-2,k) - h
    for n in (0..9): [A124038(n,k) for k in (0..n)] # Peter Luschny, Nov 20 2012
    
  • SageMath
    from sage.combinat.q_analogues import q_stirling_number2
    def A124038(n,k): return (1 + ((n-k)%2))*q_stirling_number2(n+1, n-k+1, -1)
    print(flatten([[A124038(n, k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Jan 22 2025
    

Formula

From G. C. Greubel, Jan 22 2025: (Start)
T(n, k) = T(n-1, k-1) - T(n-2, k), with T(n, n) = 1, T(n, n-1) = -2.
T(n, k) = (-1)^floor((n-k+1)/2)*(1 + (n-k mod 2))*qStirling2(n+1, n-k+1,-1).
T(2*n, n) = (1/2)*(-1)^floor(n/2)*( (1+(-1)^n)*A005809(n/2) - 2*(1-(-1)^n)* A045721((n-1)/2) ). (End)

Extensions

Edited by G. C. Greubel, Jan 22 2025

A374438 Triangle read by rows: T(n, k) = T(n - 1, k) + T(n - 2, k - 2), with initial values T(n, k) = k + 1 for k < 3.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2, 3, 4, 3, 1, 2, 3, 6, 6, 2, 1, 2, 3, 8, 9, 6, 3, 1, 2, 3, 10, 12, 12, 9, 2, 1, 2, 3, 12, 15, 20, 18, 8, 3, 1, 2, 3, 14, 18, 30, 30, 20, 12, 2, 1, 2, 3, 16, 21, 42, 45, 40, 30, 10, 3, 1, 2, 3, 18, 24, 56, 63, 70, 60, 30, 15, 2
Offset: 0

Views

Author

Peter Luschny, Jul 22 2024

Keywords

Comments

See A374439 and the cross-references for comments about this family of triangles, where the recurrence is defined as in the name, but with an additional parameter m for the initial values: T(n, k) = k + 1 for k < m.
As m -> oo, the rows of the triangles become the initial segments of the integers.

Examples

			Triangle starts:
  [ 0] [1]
  [ 1] [1, 2]
  [ 2] [1, 2, 3]
  [ 3] [1, 2, 3,  2]
  [ 4] [1, 2, 3,  4,  3]
  [ 5] [1, 2, 3,  6,  6,  2]
  [ 6] [1, 2, 3,  8,  9,  6,  3]
  [ 7] [1, 2, 3, 10, 12, 12,  9,  2]
  [ 8] [1, 2, 3, 12, 15, 20, 18,  8,  3]
  [ 9] [1, 2, 3, 14, 18, 30, 30, 20, 12,  2]
  [10] [1, 2, 3, 16, 21, 42, 45, 40, 30, 10, 3]
		

Crossrefs

Family of triangles: A162515 (m=1, Fibonacci), A374439 (m=2, Lucas), this triangle (m=3).
Row sums: A187890 (apart from initial terms), also A001060 + 1 (with 1 prepended).
Cf. A006355 (odd sums), A187893 (even sums).
Cf. related to deltas: A065220, A210673.

Programs

  • Maple
    M := 3;  # family index
    T := proc(n, k) option remember; if k > n then 0 elif k < M then k + 1 else
    T(n - 1, k) + T(n - 2, k - 2) fi end:
    seq(seq(T(n, k), k = 0..n), n = 0..11);
  • Python
    from functools import cache
    @cache
    def T(n: int, k: int) -> int:
        if k > n: return 0
        if k < 3: return k + 1
        return T(n - 1, k) + T(n - 2, k - 2)

A374429 Triangle read by rows: T(n, k) = ((3*(-1)^k + 1)/2)*abs(qStirling2(n, k, -1)). Polynomials related to the Lucas and Fibonacci numbers.

Original entry on oeis.org

2, 0, -1, 0, -1, 2, 0, -1, 2, -1, 0, -1, 2, -2, 2, 0, -1, 2, -3, 4, -1, 0, -1, 2, -4, 6, -3, 2, 0, -1, 2, -5, 8, -6, 6, -1, 0, -1, 2, -6, 10, -10, 12, -4, 2, 0, -1, 2, -7, 12, -15, 20, -10, 8, -1, 0, -1, 2, -8, 14, -21, 30, -20, 20, -5, 2
Offset: 0

Views

Author

Peter Luschny, Jul 25 2024

Keywords

Comments

The idea behind the Fibonacci and Lucas sequences is simple: Put the '2' in the middle of a band and place a '1' to the left and a '-1' to the right. Now add the sum of the two immediate numbers with higher indexes on the left side and on the right side the sum of the two with lower indexes. Schematically, after a few steps, it looks like this:
..., 18, 11, 7, 4, 3, 1, <-- + [2] + --> -1, 1, 0, 1, 1, 2, 3, 5, ...
This generates the Lucas sequence on the left (with a descending index) and the Fibonacci sequence on the right (with an ascending index). The fact that the first two terms (-1, 1) of the Fibonacci sequence were 'forgotten' in A000045 is from our point of view only a difference in the choice of the offset of the central term. Our choice is, in any case, consistent with Knuth's continuation of the Fibonacci numbers into the negative range (A039834).
This construction is to be captured in a family of polynomials. The idea is that the two sequences are the values of the polynomials at the points x = -1 and x = 1. This continues from A374439. Here we choose signed coefficients and shift the powers up by one.
This approach also reveals that another important sequence follows the same logic: the Pell numbers (A000129). These, and their dual counterpart A048654, are interpolated by the polynomials at the points x = 1/2 and x = -1/2 (up to the normalization factor 2^n). The table in the example section gives an overview.
The formal representation is based on the qStirling2 numbers in the version defined in SageMath (see also A065941 and A333143).

Examples

			Triangle starts:
  [0] [2]
  [1] [0, -1]
  [2] [0, -1, 2]
  [3] [0, -1, 2, -1]
  [4] [0, -1, 2, -2,  2]
  [5] [0, -1, 2, -3,  4,  -1]
  [6] [0, -1, 2, -4,  6,  -3,  2]
  [7] [0, -1, 2, -5,  8,  -6,  6,  -1]
  [8] [0, -1, 2, -6, 10, -10, 12,  -4, 2]
  [9] [0, -1, 2, -7, 12, -15, 20, -10, 8, -1]
.
Table of interpolated sequences:
  |    | A039834 & A000045 | A000032 |   A000129  |   A048654  |
  |  n |      P(n, 1)      | P(n,-1) |-2^nP(n,1/2)|2^nP(n,-1/2)|
  |    |     Fibonacci     |  Lucas  |    Pell    |    Pell*   |
  |  1 |        -1         |    1    |       1    |       1    |
  |  2 |         1         |    3    |       0    |       4    |
  |  3 |         0         |    4    |       1    |       9    |
  |  4 |         1         |    7    |       2    |      22    |
  |  5 |         1         |   11    |       5    |      53    |
  |  6 |         2         |   18    |      12    |     128    |
  |  7 |         3         |   29    |      29    |     309    |
  |  8 |         5         |   47    |      70    |     746    |
  |  9 |         8         |   76    |     169    |    1801    |
  | 10 |        13         |  123    |     408    |    4348    |
		

Crossrefs

Cf. A000045 (Fibonacci), A039834 (negaFibonacci), A000204 (Lucas), A000129 (Pell), A048654 (dual Pell), A065941 (qStirling2).
Cf. A374439 (variant).

Programs

  • SageMath
    from sage.combinat.q_analogues import q_stirling_number2
    def T(n, k):
        return ((3*(-1)^k + 1)//2)*abs(q_stirling_number2(n, k, -1))
    for n in range(10): print([T(n, k) for k in range(n + 1)])
    def P(n, x):
        if n < 0: return P(-n, -x)
        return sum(T(n, k)*x^k for k in range(n + 1))
    # Lucas and Fibonacci combined
    print([P(n, 1) for n in range(-6, 9)])
    # Table of interpolated sequences
    print("|    | A039834 & A000045 | A000032 |   A000129  |   A048654  |")
    print("|  n |      P(n, 1)      | P(n,-1) |-2^nP(n,1/2)|2^nP(n,-1/2)|")
    f = "| {0:2d} | {1:9d}         | {2:4d}    | {3:7d}    | {4:7d}    |"
    for n in range(1, 11): print(f.format(n, P(n, 1), P(n, -1),
                           int(-2**n*P(n, 1/2)), int(2**n*P(n, -1/2))))
Showing 1-8 of 8 results.