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 11-20 of 43 results. Next

A120562 Sum of binomial coefficients binomial(i+j, i) modulo 2 over all pairs (i,j) of positive integers satisfying 3i+j=n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 3, 1, 3, 2, 3, 2, 4, 3, 5, 1, 4, 3, 4, 2, 5, 3, 5, 2, 5, 4, 6, 3, 7, 5, 8, 1, 6, 4, 5, 3, 7, 4, 7, 2, 6, 5, 7, 3, 8, 5, 8, 2, 7, 5, 7, 4, 9, 6, 10, 3, 9, 7, 10, 5, 12, 8, 13, 1
Offset: 0

Views

Author

Sam Northshield (samuel.northshield(AT)plattsburgh.edu), Aug 07 2006

Keywords

Comments

a(n) is the number of 'vectors' (..., e_k, e_{k-1}, ..., e_0) with e_k in {0,1,3} such that Sum_{k} e_k 2^k = n. a(2^n-1) = F(n+1)*a(2^{k+1}+j) + a(j) = a(2^k+j) + a(2^{k-1}+j) if 2^k > 4j. This sequence corresponds to the pair (3,1) as Stern's diatomic sequence [A002487] corresponds to (2,1) and Gould's sequence [A001316] corresponds to (1,1). There are many interesting similarities to A000119, the number of representations of n as a sum of distinct Fibonacci numbers.
A120562 can be generated from triangle A177444. Partial sums of A120562 = A177445. - Gary W. Adamson, May 08 2010
The Ca1 and Ca2 triangle sums, see A180662 for their definitions, of Sierpinski's triangle A047999 equal this sequence. Some A120562(2^n-p) sequences, 0 <= p <= 32, lead to known sequences, see the crossrefs. - Johannes W. Meijer, Jun 05 2011

Examples

			a(2^n)=1 since a(2n)=a(n).
		

Crossrefs

Cf. A001316 (1,1), A002487 (2,1), A120562 (3,1), A112970 (4,1), A191373 (5,1).
Cf. A177444, A177445. - Gary W. Adamson, May 08 2010
Cf. A000012 (p=0), A000045 (p=1, p=2, p=4, p=8, p=16, p=32), A000071 (p=3, p=6, p=12, p=13, p=24, p=26), A001610 (p=5, p=10, p=20), A001595 (p=7, p=14, p=28), A014739 (p=11, p=22, p=29), A111314 (p=15, p=30), A027961 (p=19), A154691 (p=21), A001911 (p=23). - Johannes W. Meijer, Jun 05 2011
Same recurrence for odd n as A000930.

Programs

  • Maple
    p := product((1+x^(2^i)+x^(3*2^i)), i=0..25): s := series(p, x, 1000): for k from 0 to 250 do printf(`%d, `, coeff(s, x, k)) od:
    A120562:=proc(n) option remember; if n <0 then A120562(n):=0 fi: if (n=0 or n=1) then 1 elif n mod 2 = 0 then A120562(n/2) else A120562((n-1)/2) + A120562((n-3)/2); fi; end: seq(A120562(n),n=0..64); # Johannes W. Meijer, Jun 05 2011
  • Mathematica
    a[0] = a[1] = 1; a[n_?EvenQ] := a[n] = a[n/2]; a[n_?OddQ] := a[n] = a[(n-1)/2] + a[(n-1)/2 - 1]; Table[a[n], {n, 0, 64}] (* Jean-François Alcover, Sep 29 2011 *)
    Nest[Append[#1, If[EvenQ@ #2, #1[[#2/2 + 1]], Total@ #1[[#2 ;; #2 + 1]] & @@ {#1, (#2 - 1)/2}]] & @@ {#, Length@ #} &, {1, 1}, 10^4 - 1] (* Michael De Vlieger, Feb 19 2019 *)

Formula

Recurrence; a(0)=a(1)=1, a(2*n)=a(n) and a(2*n+1)=a(n)+a(n-1).
G.f.: A(x) = Product_{i>=0} (1 + x^(2^i) + x^(3*2^i)) = (1 + x + x^3)*A(x^2).
a(n-1) << n^x with x = log_2(phi) = 0.69424... - Charles R Greathouse IV, Dec 27 2011

Extensions

Reference edited and link added by Jason G. Wurtzel, Aug 22 2010

A069403 a(n) = 2*Fibonacci(2*n+1) - 1.

Original entry on oeis.org

1, 3, 9, 25, 67, 177, 465, 1219, 3193, 8361, 21891, 57313, 150049, 392835, 1028457, 2692537, 7049155, 18454929, 48315633, 126491971, 331160281, 866988873, 2269806339, 5942430145, 15557484097, 40730022147, 106632582345, 279167724889, 730870592323, 1913444052081
Offset: 0

Views

Author

R. H. Hardin, Mar 22 2002

Keywords

Comments

Half the number of n X 3 binary arrays with a path of adjacent 1's and a path of adjacent 0's from top row to bottom row.
Indices of A017245 = 9*n + 7 = 7, 16, 25, 34, for submitted A153819 = 16, 34, 88,. A153819(n) = 9*a(n) + 7 = 18*F(2*n+1) -2; F(n) = Fibonacci = A000045, 2's = A007395. Other recurrence: a(n) = 4*a(n-1) - 4*a(n-2) + a(n-3). - Paul Curtz, Jan 02 2009

Crossrefs

Cf. 1 X n A000225, 2 X n A016269, vertical path of 1 A069361-A069395, vertical paths of 0+1 A069396-A069416, vertical path of 1 not 0 A069417-A069428, no vertical paths A069429-A069447, no horizontal or vertical paths A069448-A069452.
Equals A052995 - 1.
Bisection of A001595, A062114, A066983.

Programs

  • GAP
    List([0..30], n-> 2*Fibonacci(2*n+1)-1); # G. C. Greubel, Jul 11 2019
  • Magma
    [2*Fibonacci(2*n+1)-1: n in [0..30]]; // Vincenzo Librandi, Apr 18 2011
    
  • Mathematica
    a[n_]:= a[n] = 3a[n-1] - 3a[n-3] + a[n-4]; a[0] = 1; a[1] = 3; a[2] = 9; a[3] = 25; Table[ a[n], {n, 0, 30}]
    Table[2*Fibonacci[2*n+1]-1, {n,0,30}] (* G. C. Greubel, Apr 22 2018 *)
    LinearRecurrence[{4,-4,1},{1,3,9},30] (* Harvey P. Dale, Sep 22 2020 *)
  • PARI
    a(n) = 2*fibonacci(2*n+1)-1 \\ Charles R Greathouse IV, Jun 11 2015
    
  • PARI
    Vec((1-x+x^2)/((1-x)*(1-3*x+x^2)) + O(x^30)) \\ Colin Barker, Nov 02 2016
    
  • Sage
    [2*fibonacci(2*n+1)-1 for n in (0..30)] # G. C. Greubel, Jul 11 2019
    

Formula

a(0) = 1, a(1) = 3, a(2) = 9, a(3) = 25; a(n) = 3*a(n-1) - 3*a(n-3) + a(n-4).
a(n) = 3*a(n-1) - a(n-2) + 1 for n>1, a(1) = 3, a(0) = 0. - Reinhard Zumkeller, May 02 2006
From R. J. Mathar, Feb 23 2009: (Start)
a(n) = 4*a(n-1) - 4*a(n-2) + a(n-3).
G.f.: (1-x+x^2)/((1-x)*(1-3*x+x^2)). (End)
a(n) = 1 + 2*Sum_{k=0..n} Fibonacci(2*k) = 1+2*A027941(n). - Gary Detlefs, Dec 07 2010
a(n) = (2^(-n)*(-5*2^n -(3-sqrt(5))^n*(-5+sqrt(5)) +(3+sqrt(5))^n*(5+sqrt(5))))/5. - Colin Barker, Nov 02 2016

Extensions

Simpler definition from Vladeta Jovovic, Mar 19 2003

A124927 Triangle read by rows: T(n,0)=1, T(n,k)=2*binomial(n,k) if k>0 (0<=k<=n).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 1, 6, 6, 2, 1, 8, 12, 8, 2, 1, 10, 20, 20, 10, 2, 1, 12, 30, 40, 30, 12, 2, 1, 14, 42, 70, 70, 42, 14, 2, 1, 16, 56, 112, 140, 112, 56, 16, 2, 1, 18, 72, 168, 252, 252, 168, 72, 18, 2, 1, 20, 90, 240, 420, 504, 420, 240, 90, 20, 2, 1, 22, 110, 330, 660, 924, 924, 660, 330, 110, 22, 2
Offset: 0

Views

Author

Gary W. Adamson, Nov 12 2006

Keywords

Comments

Pascal triangle with all entries doubled except for the first entry in each row. A028326 with first column replaced by 1's. Row sums are 2^(n+1)-1.
From Paul Barry, Sep 19 2008: (Start)
Reversal of A129994. Diagonal sums are A001595. T(2n,n) is A100320.
Binomial transform of matrix with 1,2,2,2,... on main diagonal, zero elsewhere. (End)
This sequence is jointly generated with A210042 as an array of coefficients of polynomials v(n,x): initially, u(1,x)=v(1,x)=1; for n>1, u(n,x)=u(n-1,x)+v(n-1,x) +1 and v(n,x)=x*u(n-1,x)+x*v(n-1,x). See the Mathematica section. - Clark Kimberling, Mar 09 2012
Subtriangle of the triangle given by (1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 2, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Mar 25 2012

Examples

			Triangle starts:
  1;
  1,  2;
  1,  4,  2;
  1,  6,  6,  2;
  1,  8, 12,  8,  2;
  1, 10, 20, 20, 10, 2;
(1, 0, 0, 1, 0, 0, ...) DELTA (0, 2, -1, 0, 0, ...) begins:
  1;
  1,  0;
  1,  2,  0;
  1,  4,  2,  0;
  1,  6,  6,  2,  0;
  1,  8, 12,  8,  2, 0;
  1, 10, 20, 20, 10, 2, 0. - _Philippe Deléham_, Mar 25 2012
		

Crossrefs

Cf. A000225.
Cf. A074909.

Programs

  • Haskell
    a124927 n k = a124927_tabl !! n !! k
    a124927_row n = a124927_tabl !! n
    a124927_tabl = iterate
       (\row -> zipWith (+) ([0] ++ reverse row) (row ++ [1])) [1]
    -- Reinhard Zumkeller, Mar 04 2012
    
  • Magma
    [k eq 0 select 1 else 2*Binomial(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 10 2019
    
  • Maple
    T:=proc(n,k) if k=0 then 1 else 2*binomial(n,k) fi end: for n from 0 to 12 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
  • Mathematica
    (* First program *)
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + v[n - 1, x] + 1;
    v[n_, x_] := x*u[n - 1, x] + x*v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A210042 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A124927 *) (* Clark Kimberling, Mar 17 2012 *)
    (* Second program *)
    Table[If[k==0, 1, 2*Binomial[n, k]], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jul 10 2019 *)
  • PARI
    T(n,k) = if(k==0,1, 2*binomial(n,k)); \\ G. C. Greubel, Jul 10 2019
    
  • Sage
    def T(n, k):
        if (k==0): return 1
        else: return 2*binomial(n,k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jul 10 2019

Formula

T(n,0) = 1; for n>0: T(n,n) = 2, T(n,k) = T(n-1,k) + T(n-1,n-k), 1Reinhard Zumkeller, Mar 04 2012
T(n,k) = 2*T(n-1,k) + T(n-1,k-1) - T(n-2,k) - T(n-2,k-1), T(0,0) = T(1,0) = 1, T(1,1) = 2, T(n,k) = 0 if k<0 or if k>n. - Philippe Deléham, Mar 25 2012
G.f.: (1-x+x*y)/((-1+x)*(x*y+x-1)). - R. J. Mathar, Aug 11 2015

Extensions

Edited by N. J. A. Sloane, Nov 24 2006

A131269 a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) with n>3, a(0)=1, a(1)=2, a(2)=3, a(3)=6.

Original entry on oeis.org

1, 2, 3, 6, 11, 20, 35, 60, 101, 168, 277, 454, 741, 1206, 1959, 3178, 5151, 8344, 13511, 21872, 35401, 57292, 92713, 150026, 242761, 392810, 635595, 1028430, 1664051, 2692508, 4356587, 7049124, 11405741, 18454896, 29860669, 48315598, 78176301, 126491934
Offset: 0

Views

Author

Gary W. Adamson, Jun 23 2007

Keywords

Comments

Row sums of triangles A131268 and A131270.
a(n)/a(n-1) tends to phi (A001622).

Examples

			a(4) = 11 = sum of row 4 terms of triangle A131268: (1 + 1 + 5 + 3 + 1), or the reversed terms of triangle A131270, row 4.
		

Crossrefs

Cf. A001595 (first differences).

Programs

  • GAP
    List([0..40], n-> 2*Fibonacci(n+2)-n-1); # G. C. Greubel, Jul 09 2019
  • Magma
    /* By the first comment: */ [&+[2*Binomial(n-Floor((k+1)/2), Floor(k/2))-1: k in [0..n]]: n in [0..40]]; /* Bruno Berselli, May 03 2012 */
    
  • Magma
    [2*Fibonacci(n+2)-n-1: n in [0..40]]; // G. C. Greubel, Jul 09 2019
    
  • Mathematica
    LinearRecurrence[{3, -2, -1, 1}, {1, 2, 3, 6}, 41] (* Bruno Berselli, May 03 2012 *)
    Table[2*Fibonacci[n+2]-n-1, {n,0,40}] (* G. C. Greubel, Jul 09 2019 *)
  • Maxima
    makelist(expand(((1+sqrt(5))^(n+2)-(1-sqrt(5))^(n+2) )/(2^(n+1)*sqrt(5))-n-1), n, 0, 40); /* Bruno Berselli, May 03 2012 */
    
  • PARI
    Vec((1-x-x^2+2*x^3)/((1-x-x^2)*(1-x)^2)+O(x^40)) \\ Bruno Berselli, May 03 2012
    
  • PARI
    vector(40, n, n--; 2*fibonacci(n+2)-n-1) \\ G. C. Greubel, Jul 09 2019
    
  • Python
    prpr = 1
    prev = 2
    for n in range(2,99):
        current = prpr + prev + n - 2
        print(prpr, end=',')
        prpr = prev
        prev = current  # Alex Ratushnyak, May 02 2012
    
  • Sage
    [2*fibonacci(n+2)-n-1 for n in (0..40)] # G. C. Greubel, Jul 09 2019
    

Formula

a(n) = a(n-2) + a(n-1) + n - 2 with n>1, a(0)=1, a(1)=2. - Alex Ratushnyak, May 02 2012
From Bruno Berselli, May 03 2012: (Start)
G.f.: (1-x-x^2+2*x^3)/((1-x-x^2)*(1-x)^2). - Bruno Berselli, May 03 2012
a(n) = A001595(n+1) - n = A006355(n+3) - n - 1 = ((1+sqrt(5))^(n+2) - (1-sqrt(5))^(n+2))/(2^(n+1)*sqrt(5))-n-1. (End)

Extensions

Better definition and more terms from Bruno Berselli, May 03 2012

A178522 Triangle read by rows: T(n,k) is the number of nodes at level k in the Fibonacci tree of order n (n>=0, 0<=k<=n-1).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 1, 2, 4, 2, 1, 2, 4, 6, 2, 1, 2, 4, 8, 8, 2, 1, 2, 4, 8, 14, 10, 2, 1, 2, 4, 8, 16, 22, 12, 2, 1, 2, 4, 8, 16, 30, 32, 14, 2, 1, 2, 4, 8, 16, 32, 52, 44, 16, 2, 1, 2, 4, 8, 16, 32, 62, 84, 58, 18, 2, 1, 2, 4, 8, 16, 32, 64, 114, 128, 74, 20, 2, 1, 2, 4, 8, 16, 32, 64, 126
Offset: 0

Views

Author

Emeric Deutsch, Jun 15 2010

Keywords

Comments

A Fibonacci tree of order n (n>=2) is a complete binary tree whose left subtree is the Fibonacci tree of order n-1 and whose right subtree is the Fibonacci tree of order n-2; each of the Fibonacci trees of order 0 and 1 is defined as a single node.
Sum of entries in row n is A001595(n).
Sum_{k=0..n-1} k*T(n,k) = A178523(n).

Examples

			Triangle starts:
1,
1,
1,2,
1,2,2,
1,2,4,2,
1,2,4,6,2,
1,2,4,8,8,2,
1,2,4,8,14,10,2,
1,2,4,8,16,22,12,2,
1,2,4,8,16,30,32,14,2,
...
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 3, 2nd edition, Addison-Wesley, Reading, MA, 1998, p. 417.

Crossrefs

Cf. A001595, A059214, A178523, A067331, A002940. See A059250 for another version.

Programs

  • Maple
    G := (1-t*z+t*z^2)/((1-z)*(1-t*z-t*z^2)): Gser := simplify(series(G, z = 0, 17)): for n from 0 to 15 do P[n] := sort(coeff(Gser, z, n)) end do: 1; for n to 13 do seq(coeff(P[n], t, k), k = 0 .. n-1) end do; # yields sequence in triangular form

Formula

G.f.: G(t,z)=(1-tz+tz^2)/[(1-z)(1-tz-tz^2)].
T(k,n) = T(k-1,n-1)+T(k-1,n) with T(0,0)=1, T(k,0)=1 for k>0, T(0,n)=2 for n>0. - Frank M Jackson, Aug 30 2011

A208673 Number of words A(n,k), either empty or beginning with the first letter of the k-ary alphabet, where each letter of the alphabet occurs n times and letters of neighboring word positions are equal or neighbors in the alphabet; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 5, 10, 1, 1, 1, 1, 9, 37, 35, 1, 1, 1, 1, 15, 163, 309, 126, 1, 1, 1, 1, 25, 640, 3593, 2751, 462, 1, 1, 1, 1, 41, 2503, 36095, 87501, 25493, 1716, 1, 1, 1, 1, 67, 9559, 362617, 2336376, 2266155, 242845, 6435, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Feb 29 2012

Keywords

Comments

Also the number of (n*k-1)-step walks on k-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that the absolute difference of the dimension indices used in consecutive steps is <= 1.
All rows are linear recurrences with constant coefficients and for n > 0 the order of the recurrence is bounded by 2*n-1. For n up to at least 20 this upper bound is exact. - Andrew Howroyd, Feb 22 2022

Examples

			A(0,0) = A(n,0) = A(0,k) = 1: the empty word.
A(2,3) = 5:
  +------+   +------+   +------+   +------+   +------+
  |aabbcc|   |aabcbc|   |aabccb|   |ababcc|   |abccba|
  +------+   +------+   +------+   +------+   +------+
  |122222|   |122222|   |122222|   |112222|   |111112|
  |001222|   |001122|   |001112|   |011222|   |011122|
  |000012|   |000112|   |000122|   |000012|   |001222|
  +------+   +------+   +------+   +------+   +------+
  |xx    |   |xx    |   |xx    |   |x x   |   |x    x|
  |  xx  |   |  x x |   |  x  x|   | x x  |   | x  x |
  |    xx|   |   x x|   |   xx |   |    xx|   |  xx  |
  +------+   +------+   +------+   +------+   +------+
Square array A(n,k) begins:
  1,  1,    1,     1,       1,         1,           1, ..
  1,  1,    1,     1,       1,         1,           1, ..
  1,  1,    3,     5,       9,        15,          25, ..
  1,  1,   10,    37,     163,       640,        2503, ..
  1,  1,   35,   309,    3593,     36095,      362617, ..
  1,  1,  126,  2751,   87501,   2336376,    62748001, ..
  1,  1,  462, 25493, 2266155, 164478048, 12085125703, ..
		

Crossrefs

Columns k=0+1, 2-4 give: A000012, A088218, A208675, A212334.
Rows n=0+1, 2-3 give: A000012, A001595, A208674.
Main diagonal gives A351759.
Cf. A208879 (cyclic alphabet), A331562.

Programs

  • Maple
    b:= proc(t, l) option remember; local n; n:= nops(l);
         `if`(n<2 or {0}={l[]}, 1,
         `if`(l[t]>0, b(t, [seq(l[i]-`if`(i=t, 1, 0), i=1..n)]), 0)+
         `if`(t0,
                      b(t+1, [seq(l[i]-`if`(i=t+1, 1, 0), i=1..n)]), 0)+
         `if`(t>1 and l[t-1]>0,
                      b(t-1, [seq(l[i]-`if`(i=t-1, 1, 0), i=1..n)]), 0))
        end:
    A:= (n, k)-> `if`(n=0 or k=0, 1, b(1, [n-1, n$(k-1)])):
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    b[t_, l_List] := b[t, l] = Module[{n = Length[l]}, If[n < 2 || {0} == Union[l], 1, If[l[[t]] > 0, b[t, Table[l[[i]] - If[i == t, 1, 0], {i, 1, n}]], 0] + If[t < n && l[[t + 1]] > 0, b[t + 1, Table[l[[i]] - If[i == t + 1, 1, 0], {i, 1, n}]], 0] + If[t > 1 && l[[t - 1]] > 0, b[t - 1, Table[l[[i]] - If[i == t - 1, 1, 0], {i, 1, n}]], 0]]]; A[n_, k_] := If[n == 0 || k == 0, 1, b[1, Join[{n - 1}, Array[n&, k - 1]]]]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Dec 27 2013, translated from Maple *)
  • PARI
    F(u)={my(n=#u); sum(k=1, n,u[k]*binomial(n-1,k-1))}
    step(u, c)={my(n=#u); vector(n, k, sum(i=max(0, 2*k-c-n), k-1, sum(j=0, n-2*k+i+c, u[k-i+j]*binomial(n-1, 2*k-1-c-i+j)*binomial(k-1, k-i-1)*binomial(k-i+j-c, j) ))) }
    R(n,k)={my(r=vector(n+1), u=vector(k), v=vector(k)); u[1]=v[1]=r[1]=r[2]=1; for(n=3, #r, u=step(u,1); v=step(v,0)+u; r[n]=F(v)); r}
    T(n,k)={if(n==0||k==0, 1, R(k,n)[1+k])} \\ Andrew Howroyd, Feb 22 2022

A117501 Triangle generated from an array of generalized Fibonacci-like terms.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 3, 3, 1, 4, 4, 5, 5, 1, 5, 5, 7, 8, 8, 1, 6, 6, 9, 11, 13, 13, 1, 7, 7, 11, 14, 18, 21, 21, 1, 8, 8, 13, 17, 23, 29, 34, 34, 1, 9, 9, 15, 20, 28, 37, 47, 55, 55, 1, 10, 10, 17, 23, 33, 45, 60, 76, 89, 89, 1, 11, 11, 19, 26, 38, 53, 73, 97, 123, 144, 144
Offset: 1

Views

Author

Gary W. Adamson, Mar 23 2006

Keywords

Comments

Difference terms of the array columns in triangle format becomes A117502.
Row sums of the triangle are A104161: (1, 2, 5, 10, 19, 34, 59, ...), generated by a(k) = a(k-1) + a(k-2) + n.
This is the lower triangular version of A109754 (without a row and column 0). - Ross La Haye, Apr 12 2006

Examples

			First few rows of the array T(n,k) are:
       k=1 k=2 k=3 k=4 k=5 k=6
  n=1:  1,  1,  2,  3,  5,  8, ...
  n=2:  1,  2,  3,  5,  8, 13, ...
  n=3:  1,  3,  4,  7, 11, 18, ...
  n=4:  1,  4,  5,  9, 14, 23, ...
  n=5:  1,  5,  6, 11, 17, 28, ...
First few rows of the triangle are:
  1;
  1, 1;
  1, 2, 2;
  1, 3, 3,  3;
  1, 4, 4,  5,  5;
  1, 5, 5,  7,  8,  8;
  1, 6, 6,  9, 11, 13, 13;
  1, 7, 7, 11, 14, 18, 21, 21; ...
		

Crossrefs

Cf. A000045, A001595, A104161 (diagonal sums), A109754 (with column of 0's), A117502.

Programs

  • GAP
    F:=Fibonacci;; Flat(List([1..15], n-> List([1..n], k-> (n-k+1)*F(k-1) + F(k-2) ))); # G. C. Greubel, Jul 13 2019
  • Magma
    F:=Fibonacci; [(n-k+1)*F(k-1) + F(k-2): k in [1..n], n in [1..15]]; // G. C. Greubel, Jul 13 2019
    
  • Mathematica
    a[n_, k_] := a[n, k] = If[k==1, 1, If[k==2, n, a[n, k-1] + a[n, k-2]]]; Table[a[n-k+1, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 15 2017 *)
    T[n_, k_]:= n*Fibonacci[k-1] + Fibonacci[k-2]; Table[T[n-k+1, k], {n, 15}, {k, n}]//Flatten (* G. C. Greubel, Jul 13 2019 *)
  • PARI
    T(n,k) = n*fibonacci(k-1) + fibonacci(k-2);
    for(n=1,15, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 13 2019
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n, k):
        return 1 if k==1 else n if k==2 else a(n, k - 1) + a(n, k - 2)
    for n in range(1, 21): print([a(n - k + 1, k) for k in range(1, n + 1)]) # Indranil Ghosh, Aug 19 2017
    
  • Sage
    f=fibonacci; [[(n-k+1)*f(k-1) + f(k-2) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Jul 13 2019
    

Formula

The triangle by rows = antidiagonals of an array in which n-th row is generated by a Fibonacci-like operation: (1, n...then a(k+1) = a(k) + a(k-1)).
T(n,k) = n*Fibonacci(k-1) + Fibonacci(k-2). - G. C. Greubel, Jul 13 2019

Extensions

Row sums comment corrected by Philippe Deléham, Nov 18 2013

A154691 Expansion of (1+x+x^2) / ((1-x)*(1-x-x^2)).

Original entry on oeis.org

1, 3, 7, 13, 23, 39, 65, 107, 175, 285, 463, 751, 1217, 1971, 3191, 5165, 8359, 13527, 21889, 35419, 57311, 92733, 150047, 242783, 392833, 635619, 1028455, 1664077, 2692535, 4356615, 7049153, 11405771, 18454927, 29860701, 48315631, 78176335
Offset: 0

Views

Author

R. J. Mathar, Jan 14 2009

Keywords

Crossrefs

Programs

  • Haskell
    a154691 n = a154691_list !! n
    a154691_list = 1 : zipWith (+)
                       a154691_list (drop 2 $ map (* 2) a000045_list)
    -- Reinhard Zumkeller, Nov 17 2013
    
  • Magma
    A154691:= func< n | 2*Fibonacci(n+3) - 3 >;
    [A154691(n): n in [0..40]]; // G. C. Greubel, Jan 18 2025
    
  • Maple
    A154691 := proc(n) coeftayl( (1+x+x^2)/(1-x-x^2)/(1-x),x=0,n) ; end proc:
  • Mathematica
    Fibonacci[Range[3,60]]*2 -3 (* Vladimir Joseph Stephan Orlovsky, Mar 19 2010 *)
    CoefficientList[Series[(1 + x + x^2)/((1 - x - x^2)(1 - x)), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 18 2012 *)
  • PARI
    Vec((1+x+x^2) / ((1-x-x^2)*(1-x)) + O(x^60)) \\ Colin Barker, Feb 01 2017
    
  • Python
    def A154691(n): return 2*fibonacci(n+3) - 3
    print([A154691(n) for n in range(41)]) # G. C. Greubel, Jan 18 2025

Formula

a(n+1) - a(n) = A006355(n+3) = A055389(n+3).
a(n) = A066629(n-1) + A066629(n).
a(n) = A006355(n+4) - 3 = A078642(n+1) - 3.
a(n+1) = a(n) + 2*A000045(n+2). - Reinhard Zumkeller, Nov 17 2013
From Colin Barker, Feb 01 2017: (Start)
a(n) = -3 + (2^(1-n)*((1-r)^n*(-2+r) + (1+r)^n*(2+r))) / r where r=sqrt(5).
a(n) = 2*a(n-1) - a(n-3) for n>2. (End)
a(n) = 2*Fibonacci(n+3) - 3. - Greg Dresden, Oct 10 2020
E.g.f.: 4*exp(x/2)*(5*cosh(sqrt(5)*x/2) + 2*sqrt(5)*sinh(sqrt(5)*x/2))/5 - 3*exp(x). - Stefano Spezia, Apr 09 2025

A166863 a(1)= 1; a(2)= 5; thereafter a(n)= a(n-1) + a(n-2) + 5.

Original entry on oeis.org

1, 5, 11, 21, 37, 63, 105, 173, 283, 461, 749, 1215, 1969, 3189, 5163, 8357, 13525, 21887, 35417, 57309, 92731, 150045, 242781, 392831, 635617, 1028453, 1664075, 2692533, 4356613, 7049151, 11405769, 18454925, 29860699, 48315629, 78176333, 126491967
Offset: 1

Views

Author

Geoff Ahiakwo, Oct 22 2009

Keywords

Examples

			a(3) = 5 + 1 + 5 = 11.
		

Crossrefs

Programs

  • Haskell
    a166863 n = a166863_list !! (n-1)
    a166863_list = 1 : zipWith (+) a166863_list (drop 3 $ map (* 2) a000045_list)
    -- Reinhard Zumkeller, Nov 17 2013
  • Mathematica
    2 * Fibonacci[Range[4,4! ]] - 5 (* Vladimir Joseph Stephan Orlovsky, Mar 19 2010 *)
    RecurrenceTable[{a[1]==1,a[2]==5,a[n]==a[n-1]+a[n-2]+5},a,{n,40}] (* or *) LinearRecurrence[{2,0,-1},{1,5,11},40] (* Harvey P. Dale, Jan 29 2021 *)

Formula

a(n) = A154691(n) - 2 = 2*A000045(n+3) - 5. - R. J. Mathar, Oct 26 2009
From R. J. Mathar, Oct 26 2009: (Start)
a(n) = 2*a(n-1) - a(n-3).
G.f: x*(1+3*x+x^2)/((x-1)* (x^2+x-1)). (End)
a(n+1) = a(n) + 2*A000045(n+2). - Reinhard Zumkeller, Nov 17 2013

Extensions

Missing value for a(29) inserted by Reinhard Zumkeller, Nov 17 2013

A033538 a(0)=1, a(1)=1, a(n) = 3*a(n-1) + a(n-2) + 1.

Original entry on oeis.org

1, 1, 5, 17, 57, 189, 625, 2065, 6821, 22529, 74409, 245757, 811681, 2680801, 8854085, 29243057, 96583257, 318992829, 1053561745, 3479678065, 11492595941, 37957465889, 125364993609, 414052446717, 1367522333761, 4516619448001, 14917380677765, 49268761481297
Offset: 0

Views

Author

Keywords

Comments

Number of times certain simple recursive programs (such as the Lisp program shown) call themselves on an input of length n.
This is the sequence A(1,1;3,1;1) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010

References

  • E. Hyvönen and J. Seppänen, LISP-kurssi, Osa 6 (Funktionaalinen ohjelmointi), Prosessori 4/1983, pp. 48-50 (in Finnish).

Crossrefs

Programs

  • GAP
    a:=[1,1];; for n in [3..40] do a[n]:=3*a[n-1]+a[n-2] +1; od; a; # G. C. Greubel, Jul 10 2019
  • Haskell
    a033538 n = a033538_list !! n
    a033538_list =
       1 : 1 : (map (+ 1) $ zipWith (+) a033538_list
                                        $ map (3 *) $ tail a033538_list)
    -- Reinhard Zumkeller, Aug 14 2011
    
  • Lisp
    (defun rewerse (lista) (cond ((null (cdr lista)) lista) (t (cons (car (rewerse (cdr lista))) (rewerse (cons (car lista) (rewerse (cdr (rewerse (cdr lista))))))))))
    
  • Magma
    I:=[1,1]; [n le 2 select I[n] else 3*Self(n-1) +Self(n-2) +1: n in [1..40]]; // G. C. Greubel, Jul 10 2019
    
  • Maple
    a := proc(n) option remember; if(n < 2) then RETURN(1); else RETURN(3*a(n-1)+a(n-2)+1); fi; end;
  • Mathematica
    CoefficientList[ Series[(1-3x+3x^2)/(1-4x+2x^2+x^3), {x,0,40}], x](* Jean-François Alcover, Nov 30 2011 *)
    RecurrenceTable[{a[0]==a[1]==1,a[n]==3a[n-1]+a[n-2]+1},a,{n,40}] (* or *) LinearRecurrence[{4,-2,-1},{1,1,5},41] (* Harvey P. Dale, Jan 05 2012 *)
    Table[(4*(Fibonacci[n,3] +Fibonacci[n-1,3]) -1)/3, {n,0,30}] (* G. C. Greubel, Oct 13 2019 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -1,-2,4]^n*[1;1;5])[1,1] \\ Charles R Greathouse IV, Feb 19 2017
    
  • Sage
    ((1-3*x+3*x^2)/((1-x)*(1-3*x-x^2))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jul 10 2019
    

Formula

From R. J. Mathar, Aug 22 2008: (Start)
O.g.f.: (1-3*x+3*x^2)/((1-x)*(1-3*x-x^2)).
a(n) = (4*A006190(n+1) - 8*A006190(n) - 1)/3. (End)
a(n) = 4*a(n-1) - 2*a(n-2) - a(n-3), a(0)=1=a(1), a(2)=5. Observed by G. Detlefs. See the W. Lang link. - Wolfdieter Lang, Oct 18 2010
a(n) = (4*(F(n,3) + F(n-1,3)) -1)/3, where F(n,x) is the Fibonacci polynomial (see A102426). - G. C. Greubel, Oct 13 2019
Previous Showing 11-20 of 43 results. Next