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.

Previous Showing 21-30 of 43 results. Next

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
    

A026552 Irregular triangular array T read by rows: T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor(n/2 + 1), for even n >= 2, T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), otherwise T(n, k) = T(n-1, k-2) + T(n-1, k).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 2, 4, 4, 4, 2, 1, 1, 3, 7, 10, 12, 10, 7, 3, 1, 1, 3, 8, 13, 19, 20, 19, 13, 8, 3, 1, 1, 4, 12, 24, 40, 52, 58, 52, 40, 24, 12, 4, 1, 1, 4, 13, 28, 52, 76, 98, 104, 98, 76, 52, 28, 13, 4, 1, 1, 5, 18, 45, 93, 156, 226, 278
Offset: 0

Views

Author

Keywords

Comments

T(n, k) = number of integer strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i)-s(i-1)|<=1 if i is even or i = 1, |s(i)-s(i-1)| = 1 if i is odd and i >= 3.

Examples

			First 5 rows:
  1;
  1, 1, 1;
  1, 2, 3,  2,  1;
  1, 2, 4,  4,  4,  2,  1;
  1, 3, 7, 10, 12, 10,  7,  3,  1;
		

Crossrefs

Programs

  • Mathematica
    z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2 + 1]; t[n_, k_] := Floor[n/2 + 1] /; k == 2 n - 1; t[n_, k_] := t[n, k] = If[EvenQ[n], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k], t[n - 1, k - 2] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
    TableForm[u] (* A026552 array *)
    v = Flatten[u] (* A026552 sequence *)
  • Sage
    @CachedFunction
    def T(n,k): # T = A026552
        if (k==0 or k==2*n): return 1
        elif (k==1 or k==2*n-1): return (n+2)//2
        elif (n%2==0): return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
        else: return T(n-1, k) + T(n-1, k-2)
    flatten([[T(n,k) for k in (0..2*n)] for n in (0..10)]) # G. C. Greubel, Dec 17 2021

Formula

Sum_{k=0..2*n} T(n,k) = A026565(n). - G. C. Greubel, Dec 17 2021

Extensions

Updated by Clark Kimberling, Aug 28 2014

A036355 Fibonacci-Pascal triangle read by rows.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 5, 5, 3, 5, 10, 14, 10, 5, 8, 20, 32, 32, 20, 8, 13, 38, 71, 84, 71, 38, 13, 21, 71, 149, 207, 207, 149, 71, 21, 34, 130, 304, 478, 556, 478, 304, 130, 34, 55, 235, 604, 1060, 1390, 1390, 1060, 604, 235, 55, 89, 420, 1177, 2272, 3310, 3736, 3310, 2272, 1177, 420, 89
Offset: 0

Views

Author

Floor van Lamoen, Dec 28 1998

Keywords

Comments

T(n,k) is the number of lattice paths from (0,0) to (n-k,k) using steps (1,0),(2,0),(0,1),(0,2). - Joerg Arndt, Jun 30 2011, corrected by Greg Dresden, Aug 25 2020
For a closed-form formula for arbitrary left and right borders of Pascal like triangle see A228196. - Boris Putievskiy, Aug 18 2013
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 09 2013

Examples

			Triangle begins
   1;
   1,   1;
   2,   2,   2;
   3,   5,   5,    3;
   5,  10,  14,   10,    5;
   8,  20,  32,   32,   20,    8;
  13,  38,  71,   84,   71,   38,   13;
  21,  71, 149,  207,  207,  149,   71,  21;
  34, 130, 304,  478,  556,  478,  304, 130,  34;
  55, 235, 604, 1060, 1390, 1390, 1060, 604, 235, 55;
with indices
  T(0,0);
  T(1,0),  T(1,1);
  T(2,0),  T(2,1),  T(2,2);
  T(3,0),  T(3,1),  T(3,2),  T(3,3);
  T(4,0),  T(4,1),  T(4,2),  T(4,3),  T(4,4);
For example, T(4,2) = 14 and there are 14 lattice paths from (0,0) to (4-2,2) = (2,2) using steps (1,0),(2,0),(0,1),(0,2). - _Greg Dresden_, Aug 25 2020
		

Crossrefs

Row sums form sequence A002605. T(n, 0) forms the Fibonacci sequence (A000045). T(n, 1) forms sequence A001629.
Derived sequences: A036681, A036682, A036683, A036684, A036692 (central terms).
Some other Fibonacci-Pascal triangles: A027926, A037027, A074829, A105809, A109906, A111006, A114197, A162741, A228074.

Programs

  • Haskell
    a036355 n k = a036355_tabl !! n !! k
    a036355_row n = a036355_tabl !! n
    a036355_tabl = [1] : f [1] [1,1] where
       f us vs = vs : f vs (zipWith (+)
                           (zipWith (+) ([0,0] ++ us) (us ++ [0,0]))
                           (zipWith (+) ([0] ++ vs) (vs ++ [0])))
    -- Reinhard Zumkeller, Apr 23 2013
  • Mathematica
    nmax = 11; t[n_, m_] := t[n, m] = tp[n-1, m-1] + tp[n-2, m-2] + tp[n-1, m] + tp[n-2, m]; tp[n_, m_] /; 0 <= m <= n && n >= 0 := t[n, m]; tp[n_, m_] = 0; t[0, 0] = 1; Flatten[ Table[t[n, m], {n, 0, nmax}, {m, 0, n}]] (* Jean-François Alcover, Nov 09 2011, after formula *)
  • PARI
    /* same as in A092566 but use */
    steps=[[1,0], [2,0], [0,1], [0,2]];
    /* Joerg Arndt, Jun 30 2011 */
    

Formula

T(n, m) = T'(n-1, m-1)+T'(n-2, m-2)+T'(n-1, m)+T'(n-2, m), where T'(n, m) = T(n, m) if 0<=m<=n and n >= 0 and T'(n, m)=0 otherwise. Initial term T(0, 0)=1.
G.f.: 1/(1-(1+y)*x-(1+y^2)*x^2). - Vladeta Jovovic, Oct 11 2003

A026536 Irregular triangular array T read by rows: T(i,0 ) = T(i,2i) = 1 for i >= 0; T(i,1) = T(i,2i-1) = floor(i/2) for i >= 1; for even n >= 2, T(i,j) = T(i-1,j-2) + T(i-1,j-1) + T(i-1,j) for j = 2..2i-2, for odd n >= 3, T(i,j) = T(i-1,j-2) + T(i-1,j) for j = 2..2i-2.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 3, 1, 1, 1, 2, 5, 6, 8, 6, 5, 2, 1, 1, 2, 6, 8, 13, 12, 13, 8, 6, 2, 1, 1, 3, 9, 16, 27, 33, 38, 33, 27, 16, 9, 3, 1, 1, 3, 10, 19, 36, 49, 65, 66, 65, 49, 36, 19, 10, 3, 1, 1, 4, 14, 32, 65, 104, 150, 180, 196, 180
Offset: 0

Views

Author

Keywords

Comments

T(n, k) is the number of strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i) - s(i-1)| <= 1 if i is even, |s(i) - s(i-1)| = 1 if i is odd.

Examples

			First 5 rows:
  1
  1  0  1
  1  1  2  1  1
  1  1  3  2  3  1  1
  1  2  5  6  8  6  5  2  1
		

Crossrefs

Programs

  • Mathematica
    z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2];
    t[n_, k_] := Floor[n/2] /; k == 2 n - 1; t[n_, k_] := t[n, k] =
    If[EvenQ[n], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k], t[n - 1, k -
    2] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
    TableForm[u]   (* A026536 array *)
    v = Flatten[u] (* A026536 sequence *)
  • SageMath
    @cached_function
    def T(n, k):
        if k < 0 or n < 0: return 0
        elif k == 0 or k == 2*n: return 1
        elif k == 1 or k == 2*n-1: return n//2
        elif n % 2 == 1: return T(n-1, k-2) + T(n-1, k)
        return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k) # Peter Luschny, Oct 13 2019

Extensions

Updated by Clark Kimberling, Aug 28 2014
Offset changed to 0 by Peter Luschny, Oct 10 2019

A026519 Irregular triangular array T read by rows: T(n, k) = T(n-1, k-2) + T(n-1, k) if (n mod 2) = 0, otherwise T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), with T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor((n+1)/2).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 4, 4, 4, 2, 1, 1, 2, 5, 6, 8, 6, 5, 2, 1, 1, 3, 8, 13, 19, 20, 19, 13, 8, 3, 1, 1, 3, 9, 16, 27, 33, 38, 33, 27, 16, 9, 3, 1, 1, 4, 13, 28, 52, 76, 98, 104, 98, 76, 52, 28, 13, 4, 1, 1, 4, 14, 32, 65, 104, 150, 180, 196, 180, 150, 104, 65, 32, 14, 4, 1
Offset: 0

Views

Author

Keywords

Comments

T(n, k) = number of integer strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i) - s(i-1)| = 1 if i is even, |s(i) - s(i-1)| <= 1 if i is odd.

Examples

			First 5 rows:
1
1 ... 1 ... 1
1 ... 1 ... 2 ... 1 ... 1
1 ... 2 ... 4 ... 4 ... 4 ... 2 ... 1
1 ... 2 ... 5 ... 6 ... 8 ... 6 ... 5 ... 2 ... 1
		

Crossrefs

Programs

  • Mathematica
    z = 12; t[n_, 0]:= 1; t[n_, k_]:= 1/; k==2n; t[n_, 1]:= Floor[(n+1)/2]; t[n_, k_] := Floor[(n+1)/2] /; k==2n-1; t[n_, k_]:= t[n, k]= If[EvenQ[n], t[n-1, k-2] + t[n-1, k], t[n-1, k-2] + t[n-1, k-1] + t[n-1, k]];
    u = Table[t[n, k], {n, 0, z}, {k, 0, 2n}];
    TableForm[u]  (* A026519 array *)
    Flatten[u] (* A026519 sequence *)
  • Sage
    @CachedFunction
    def T(n,k): # T = A026552
        if (k==0 or k==2*n): return 1
        elif (k==1 or k==2*n-1): return (n+1)//2
        elif (n%2==0): return T(n-1, k) + T(n-1, k-2)
        else: return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
    flatten([[T(n,k) for k in (0..2*n)] for n in (0..12)]) # G. C. Greubel, Dec 19 2021

Formula

T(n, k) = T(n-1, k-2) + T(n-1, k) if (n mod 2) = 0, otherwise T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), with T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor((n+1)/2).

Extensions

Updated by Clark Kimberling, Aug 29 2014
Offset changed to 0 by G. C. Greubel, Dec 19 2021

A026584 Irregular triangular array T read by rows: T(i,0) = T(i,2i) = 1 for i >= 0; T(i,1) = T(i,2i-1) = floor(i/2) for i >= 1; and for i >= 2 and j = 2..2i-2, T(i,j) = T(i-1,j-2) + T(i-1,j-1) + T(i-1,j) if i+j is odd, and T(i,j) = T(i-1,j-2) + T(i-1,j) if i+j is even.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 1, 4, 2, 4, 1, 1, 1, 2, 5, 7, 8, 7, 5, 2, 1, 1, 2, 8, 9, 20, 14, 20, 9, 8, 2, 1, 1, 3, 9, 19, 28, 43, 40, 43, 28, 19, 9, 3, 1, 1, 3, 13, 22, 56, 62, 111, 86, 111, 62, 56, 22, 13, 3, 1, 1, 4, 14, 38, 69, 140, 167, 259, 222, 259, 167, 140, 69, 38, 14, 4, 1
Offset: 1

Views

Author

Keywords

Comments

Row sums are in A026597. - Philippe Deléham, Oct 16 2006
T(n, k) = number of integer strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i)-s(i-1)| <= 1 if s(i-1) odd, |s(i)-s(i-1)| = 1 if s(i-1) is even, for i = 1..n.

Examples

			First 5 rows:
  1
  1  0  1
  1  1  2  1  1
  1  1  4  2  4  1  1
  1  2  5  7  8  7  5  2  1
		

Crossrefs

Programs

  • Mathematica
    z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2]; t[n_, k_] := Floor[n/2] /; k == 2 n - 1; t[n_, k_] := t[n, k] = If[EvenQ[n + k], t[n - 1, k - 2] + t[n - 1, k], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
    TableForm[u]   (* A026584 array *)
    v = Flatten[u] (* A026584 sequence *)
  • Sage
    @CachedFunction
    def T(n,k):
        if (k==0 or k==2*n): return 1
        elif (k==1 or k==2*n-1): return (n//2)
        else: return T(n-1, k-2) + T(n-1, k) if ((n+k)%2==0) else T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
    flatten([[T(n,k) for k in (0..2*n)] for n in (0..12)]) # G. C. Greubel, Dec 11 2021

Formula

T(n, k) = T(n-1, k-2) + T(n-1, k) if ( (n+k) mod 2 ) = 0, otherwise T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), where T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor(n/2).

Extensions

Updated by Clark Kimberling, Aug 29 2014

A026568 Irregular triangular array T read by rows: T(i,0) = T(i,2i) = 1 for i >= 0; T(i,1) = T(i,2i-1) = [ (i+1)/2 ] for i >= 1; and for i >= 2 and 2 <=j <= i - 2, T(i,j) = T(i-1,j-2) + T(i-1,j-1) + T(i-1,j) if i + j is even, T(i,j) = T(i-1,j-2) + T(i-1,j) if i + j is odd.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 4, 5, 4, 2, 1, 1, 2, 7, 7, 13, 7, 7, 2, 1, 1, 3, 8, 16, 20, 27, 20, 16, 8, 3, 1, 1, 3, 12, 19, 44, 43, 67, 43, 44, 19, 12, 3, 1, 1, 4, 13, 34, 56, 106, 111, 153, 111, 106, 56, 34, 13, 4, 1, 1, 4, 18, 38, 103, 140, 273
Offset: 1

Views

Author

Keywords

Comments

T(n, k) = number of strings s(0)..s(n) such that s(0) = 0, s(n) = n - k, |s(i)-s(i-1)| <= 1 if s(i-1) is even, |s(i)-s(i-1)| = 1 if s(i-1) is odd, for 1 <= i <= n.

Examples

			First 5 rows:
  1
  1  1  1
  1  1  3  1  1
  1  2  4  5  4  2  1
  1  2  7  7 13  7  7  2  1
		

Crossrefs

Cf. T(n,n) is A026569.

Programs

  • Mathematica
    z = 12; t[n_, 0] := 1; t[n_, 1] := Floor[(n + 1)/2]; t[n_, k_] := t[n, k] = Which[k == 2 n, 1, k == 2 n - 1, Floor[(n + 1)/2], EvenQ[n + k], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k], OddQ[n + k], t[n - 1, k - 2] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
    TableForm[u] (* A026568 array *)
    Flatten[u]   (* A026568 sequence *)
  • PARI
    T(k,n)=if(n<0||n>2*k,0,if(n==0||n==2*k,1,if(k>0&&(n==1||n==2*k-1),(k+1)\2,T(k-1,n-2)+T(k-1,n)+if((k+n)%2==0,T(k-1,n-1))))) \\ Ralf Stephan

Extensions

Updated by Clark Kimberling, Aug 28 2014

A027934 a(0)=0, a(1)=1, a(2)=2; for n > 2, a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3).

Original entry on oeis.org

0, 1, 2, 5, 11, 24, 51, 107, 222, 457, 935, 1904, 3863, 7815, 15774, 31781, 63939, 128488, 257963, 517523, 1037630, 2079441, 4165647, 8342240, 16702191, 33433039, 66912446, 133899917, 267921227, 536038872, 1072395555, 2145305339
Offset: 0

Views

Author

Keywords

Comments

Number of compositions of n with at least one even part (offset 2). - Vladeta Jovovic, Dec 29 2004
First differences of A008466. a(n) = A008466(n+2) - A008466(n+1). - Alexander Adamchuk, Apr 06 2006
Starting with "1" = eigensequence of a triangle with the Fibonacci series as the left border and the rest 1's. - Gary W. Adamson, Jul 24 2010
An elephant sequence, see A175654. For the corner squares 24 A[5] vectors, with decimal values between 11 and 416, lead to this sequence (without the leading 0). For the central square these vectors lead to the companion sequence A099036 (without the first leading 1). - Johannes W. Meijer, Aug 15 2010
a(n) = Sum_{k=1..n} A108617(n,k) / 2. - Reinhard Zumkeller, Oct 07 2012
a(n) is the number of binary strings that contain the substring 11 or end in 1. a(3) = 5 because we have: 001, 011, 101, 110, 111. - Geoffrey Critzer, Jan 04 2014
a(n-1), n >= 1, is the number of nonexisting (due to the maturation delay) "[male-female] pairs of Fibonacci rabbits" at the beginning of the n-th month. - Daniel Forgues, May 06 2015
a(n-1) is the number of subsets of {1,2,..,n} that contain n that have at least one pair of consecutive integers. For example, for n=5, a(4) = 11 and the 11 subsets are {4,5}, {1,2,5}, {1,4,5}, {2,3,5}, {2,4,5}, {3,4,5}, {1,2,3,5}, {1,2,4,5}, {1,3,4,5}, {2,3,4,5}, {1,2,3,4,5}. Note that A008466(n) is the number of all subsets of {1,2,..,n} that have at least one pair of consecutive integers. - Enrique Navarrete, Aug 15 2020

Crossrefs

Row sums of triangle A131767. - Gary W. Adamson, Jul 13 2007
a(n) = A101220(1, 2, n+1).
T(n, n) + T(n, n+1) + ... + T(n, 2n), T given by A027926.
Diagonal sums of A055248.

Programs

  • GAP
    List([0..35], n-> 2^n - Fibonacci(n+1) ); # G. C. Greubel, Sep 27 2019
  • Haskell
    a027934 n = a027934_list !! n
    a027934_list = 0 : 1 : 2 : zipWith3 (\x y z -> 3 * x - y - 2 * z)
                   (drop 2 a027934_list) (tail a027934_list) a027934_list
    -- Reinhard Zumkeller, Oct 07 2012
    
  • Magma
    [2^n - Fibonacci(n+1): n in [0..35]]; // G. C. Greubel, Sep 27 2019
    
  • Maple
    A027934:= proc(n) local K; K:= Matrix ([[2,0,0], [0,1,1], [0,1,0]])^n; K[1,1]-K[2,2] end: seq (A027934(n), n=0..31); # Alois P. Heinz, Jul 28 2008
    a := n -> 2^n - combinat:-fibonacci(n+1): seq(a(n),n=0..31); # Peter Luschny, May 09 2015
  • Mathematica
    nn=31; a:=1/(1-x-x^2); b:=1/(1-2x); CoefficientList[Series[a*x*(1+x*b), {x,0,nn}], x] (* Geoffrey Critzer, Jan 04 2014 *)
    LinearRecurrence[{3,-1,-2}, {0,1,2}, 32] (* Jean-François Alcover, Jan 09 2016 *)
    nxt[{a_,b_,c_}]:={b,c,3c-b-2a}; NestList[nxt,{0,1,2},40][[;;,1]] (* Harvey P. Dale, Feb 02 2025 *)
  • PARI
    a(n)=2^n-fibonacci(n+1) \\ Charles R Greathouse IV, Jun 11 2015
    
  • Sage
    [2^n - fibonacci(n+1) for n in (0..35)] # G. C. Greubel, Sep 27 2019
    

Formula

a(n) = Sum_{j=0..floor(n/2)} Sum_{k=0..n-2*j} binomial(n-j, n-2*j-k). - Paul Barry, Feb 07 2003
From Paul Barry, Jan 23 2004: (Start)
Row sums of A105809.
G.f.: x*(1-x)/((1-2*x)*(1-x-x^2)).
a(n) = 2^n - Fibonacci(n+1). (End) - corrected Apr 06 2006 and Oct 05 2012
a(n) = Sum_{j=0..n} Sum_{k=0..n} binomial(n-k, k+j). - Paul Barry, Aug 29 2004
a(n) = (Sum of (n+1)-th row of the triangle in A108617) / 2. - Reinhard Zumkeller, Jun 12 2005
a(n) = term (1,1) - term (2,2) in the 3 X 3 matrix [2,0,0; 0,1,1; 0,1,0]^n. - Alois P. Heinz, Jul 28 2008
a(n) = 2^n - A000045(n+1). - Geoffrey Critzer, Jan 04 2014
a(n) ~ 2^n. - Daniel Forgues, May 06 2015
From Bob Selcoe, Mar 29 2016: (Start)
a(n) = 2*a(n-1) + A000045(n-2).
a(n) = 4*a(n-2) + A000032(n-2). (End)
a(n) = 2^(n-1) - ( ((1+sqrt(5))/2)^n - ((1-sqrt(5))/2)^n)/sqrt(5). - Haider Ali Abdel-Abbas, Aug 17 2019

Extensions

Simpler definition from Miklos Kristof, Nov 24 2003
Initial zero added by N. J. A. Sloane, Feb 13 2008
Definition fixed by Reinhard Zumkeller, Oct 07 2012

A074829 Triangle formed by Pascal's rule, except that the n-th row begins and ends with the n-th Fibonacci number.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 4, 4, 3, 5, 7, 8, 7, 5, 8, 12, 15, 15, 12, 8, 13, 20, 27, 30, 27, 20, 13, 21, 33, 47, 57, 57, 47, 33, 21, 34, 54, 80, 104, 114, 104, 80, 54, 34, 55, 88, 134, 184, 218, 218, 184, 134, 88, 55, 89, 143, 222, 318, 402, 436, 402, 318, 222, 143, 89
Offset: 1

Views

Author

Joseph L. Pe, Sep 30 2002

Keywords

Examples

			The first and second Fibonacci numbers are 1, 1, so the first and second rows of the triangle are 1; 1 1; respectively. The third row of the triangle begins and ends with the third Fibonacci number, 2 and the middle term is the sum of the contiguous two terms in the second row, i.e., 1 + 1 = 2, so the third row is 2 2 2.
Triangle begins:
   1;
   1,  1;
   2,  2,  2;
   3,  4,  4,   3;
   5,  7,  8,   7,   5;
   8, 12, 15,  15,  12,   8;
  13, 20, 27,  30,  27,  20, 13;
  21, 33, 47,  57,  57,  47, 33, 21;
  34, 54, 80, 104, 114, 104, 80, 54, 34;
  ...
Formatted as a symmetric triangle:
                           1;
                        1,    1;
                     2,    2,    2;
                  3,    4,    4,    3;
               5,    7,    8,    7,    5;
            8,   12,   15,   15,   12,    8;
        13,   20,   27,   30,   27,   20,   13;
     21,   33,   47,   57,   57,   47,   33,   21;
  34,   54,   80,  104,  114,  104,   80,   54,   34;
		

Crossrefs

Some other Fibonacci-Pascal triangles: A027926, A036355, A037027, A105809, A108617, A109906, A111006, A114197, A162741, A228074.
Cf. A074878 (row sums).

Programs

  • GAP
    T:= function(n,k)
        if k=1 then return Fibonacci(n);
        elif k=n then return Fibonacci(n);
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([1..15], n-> List([1..n], k-> T(n,k) ))); # G. C. Greubel, Jul 12 2019
  • Haskell
    a074829 n k = a074829_tabl !! (n-1) !! (k-1)
    a074829_row n = a074829_tabl !! (n-1)
    a074829_tabl = map fst $ iterate
       (\(u:_, vs) -> (vs, zipWith (+) ([u] ++ vs) (vs ++ [u]))) ([1], [1,1])
    -- Reinhard Zumkeller, Aug 15 2013
    
  • Maple
    A074829 := proc(n,k)
        option remember ;
        if k=1 or k=n then
            combinat[fibonacci](n) ;
        else
            procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc:
    seq(seq(A074829(n,k),k=1..n),n=1..12) ; # R. J. Mathar, Mar 31 2025
  • Mathematica
    T[n_, 1]:= Fibonacci[n]; T[n_, n_]:= Fibonacci[n]; T[n_, k_]:= T[n-1, k-1] + T[n-1, k]; Table[T[n, k], {n, 1, 12}, {k, 1, n}]//Flatten (* G. C. Greubel, Jul 12 2019 *)
  • PARI
    T(n,k) = if(k==1 || k==n, fibonacci(n), T(n-1,k-1) + T(n-1,k));
    for(n=1,12, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 12 2019
    
  • Sage
    def T(n, k):
        if (k==1 or k==n): return fibonacci(n)
        else: return T(n-1, k-1) + T(n-1, k)
    [[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jul 12 2019
    

Extensions

More terms from Philippe Deléham, Sep 20 2006
Data error in 7th row fixed by Reinhard Zumkeller, Aug 15 2013

A246692 Numbers k such that k | A000129(k).

Original entry on oeis.org

1, 2, 4, 8, 12, 16, 24, 32, 36, 48, 60, 64, 72, 84, 96, 108, 120, 128, 132, 136, 144, 168, 180, 192, 216, 240, 252, 256, 264, 272, 288, 300, 324, 336, 360, 384, 396, 408, 420, 432, 480, 504, 512, 528, 540, 544, 576, 588, 600, 648, 660, 672, 720, 756, 768
Offset: 1

Views

Author

Clark Kimberling, Sep 01 2014

Keywords

Comments

These are the numbers k such that mean of the k-th row of the Delannoy triangle at A027926 is an integer. All such k except 0 and 1 are multiples of 4.
Is A181824 a subsequence? The first 31 terms appear in this sequence. - Jaycob Coleman, Mar 08 2015 [The first 323 terms of A181824 appear in this sequence. - Amiram Eldar, Mar 31 2021]

Examples

			Row 4 of the Delannoy triangle is (1,5,5,1), with sum 12 = A000129(4) divisible by 4.
		

Crossrefs

Programs

  • Mathematica
    z = 1000; t = LinearRecurrence[{2, 1}, {1, 2}, z]; (* A000129 *)
    Select[Range[1, z], IntegerQ[t[[#]]/#] &]   (* A246692 *)
    Table[t[[u[[n]]]]/u[[n]], {n, 1, 17}]  (* A246693 *)
Previous Showing 21-30 of 43 results. Next