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

A078012 a(n) = a(n-1) + a(n-3) for n >= 3, with a(0) = 1, a(1) = a(2) = 0. This recurrence can also be used to define a(n) for n < 0.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60, 88, 129, 189, 277, 406, 595, 872, 1278, 1873, 2745, 4023, 5896, 8641, 12664, 18560, 27201, 39865, 58425, 85626, 125491, 183916, 269542, 395033, 578949, 848491, 1243524, 1822473, 2670964, 3914488, 5736961, 8407925
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002, Mar 08 2008

Keywords

Comments

Number of compositions of n into parts >= 3. - Milan Janjic, Jun 28 2010
From Adi Dani, May 22 2011: (Start)
Number of compositions of number n into parts of the form 3*k+1, k >= 0.
For example, a(10)=19 and all compositions of 10 in parts 1,4,7 or 10 are
(1,1,1,1,1,1,1,1,1,1), (1,1,1,1,1,1,4), (1,1,1,1,1,4,1), (1,1,1,1,4,1,1), (1,1,1,4,1,1,1), (1,1,4,1,1,1,1), (1,4,1,1,1,1,1), (4,1,1,1,1,1,1), (1,1,4,4), (1,4,1,4), (1,4,4,1), (4,1,1,4),(4,1,4,1), (4,4,1,1), (1,1,1,7), (1,1,7,1), (1,7,1,1), (7,1,1,1), (10). (End)
For n >= 0 a(n+1) is the number of 00's in the Narayana word NW(n); equivalently the number of two neighboring 0's at level n of the Narayana tree. See A257234. This implies that if a(0) is put to 0 then a(n) is the number of -1's in the Narayana word NW(n), and also at level n of the Narayana tree. - Wolfdieter Lang, Apr 24 2015

Examples

			G.f. = 1 + x^3 + x^4 + x^5 + 2*x^6 + 3*x^7 + 4*x^8 + 6*x^9 + 9*x^10 + 13*x^11 + ...
		

References

  • Taylor L. Booth, Sequential Machines and Automata Theory, John Wiley and Sons, Inc., 1967, page 331ff.

Crossrefs

Programs

  • GAP
    a:=[1,0,0];; for n in [4..50] do a[n]:=a[n-1]+a[n-3]; od; a; # G. C. Greubel, Jun 28 2019
  • Haskell
    a078012 n = a078012_list !! n
    a078012_list = 1 : 0 : 0 : 1 : zipWith (+) a078012_list
       (zipWith (+) (tail a078012_list) (drop 2 a078012_list))
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Magma
    I:=[1,0,0]; [n le 3 select I[n] else Self(n-1) + Self(n-3): n in [1..50]]; // G. C. Greubel, Jan 19 2018
    
  • Maple
    A078012 := proc(n): if n=0 then 1 else add(binomial(n-3-2*i,i),i=0..(n-3)/3) fi: end: seq(A078012(n), n=0..46); # Johannes W. Meijer, Aug 11 2011
    # second Maple program:
    a:= n-> (<<0|1|0>, <0|0|1>, <1|0|1>>^n)[1, 1]:
    seq(a(n), n=0..46);  # Alois P. Heinz, May 08 2025
  • Mathematica
    CoefficientList[ Series[(1-x)/(1-x-x^3), {x,0,50}], x] (* Robert G. Wilson v, May 25 2011 *)
    LinearRecurrence[{1,0,1}, {1,0,0}, 50] (* Vladimir Joseph Stephan Orlovsky, Feb 24 2012 *)
    a[ n_]:= If[ n >= 0, SeriesCoefficient[ (1-x)/(1-x-x^3), {x, 0, n}], SeriesCoefficient[1/(1+x^2-x^3), {x, 0, -n}]]; (* Michael Somos, Feb 03 2018 *)
  • PARI
    {a(n) = if( n<0, n = -n; polcoeff( 1 / (1 + x^2 - x^3) + x * O(x^n), n), polcoeff( (1 - x) / (1 - x - x^3) + x * O(x^n), n))}; /* Michael Somos, May 03 2011 */
    
  • Sage
    ((1-x)/(1-x-x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 28 2019
    

Formula

a(n) = Sum_{i=0..(n-3)/3} binomial(n-3-2*i, i), n >= 1, a(0) = 1.
From Michael Somos, May 03 2011: (Start)
Euler transform of A065417.
G.f.: (1 - x) / (1 - x - x^3).
a(-n) = A077961(n). a(n+3) = A000930(n).
a(n+5) = A068921(n). (End)
a(n+1) = A013979(n-3) + A135851(n) + A107458(n), n >= 3.
G.f.: 1/(1 - Sum_{k>=3} x^k). - Joerg Arndt, Aug 13 2012
G.f.: Q(0)*(1-x)/2, where Q(k) = 1 + 1/(1 - x*(4*k+1 + x^2)/( x*(4*k+3 + x^2) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 08 2013
0 = -1 + a(n)*(a(n)*(a(n) + a(n+2)) + a(n+1)*(a(n+1) - 3*a(n+2))) + a(n+1)*(+a(n+1)*(+a(n+1) + a(n+2)) + a(n+2)*(-2*a(n+2))) + a(n+2)^3 for all n in Z. - Michael Somos, Feb 03 2018
a(-n) = a(n)*a(n+3) - a(n+1)*a(n+2) for all n in Z. - Greg Dresden, May 07 2025

Extensions

Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021
Entry revised by N. J. A. Sloane, May 11 2025, making use of comments from Michael Somos, May 03 2011 and Greg Dresden, May 11 2025

A077868 Expansion of 1/((1-x)*(1-x-x^3)).

Original entry on oeis.org

1, 2, 3, 5, 8, 12, 18, 27, 40, 59, 87, 128, 188, 276, 405, 594, 871, 1277, 1872, 2744, 4022, 5895, 8640, 12663, 18559, 27200, 39864, 58424, 85625, 125490, 183915, 269541, 395032, 578948, 848490, 1243523, 1822472, 2670963, 3914487, 5736960, 8407924, 12322412
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Row sums of Riordan array (1/(1-x), x*(1+x^2)). - Paul Barry, Feb 16 2005
a(n) is the number of partitions of {1, ..., n+3} into two blocks in which only 1- or 3-strings of consecutive integers can appear in a block and there is at least one 3-string. E.g., a(3)=5 because the enumerated partitions of {1,2,3,4,5,6} are 1235/46, 1345/26, 15/2346, 13/2456, 123/456. - Augustine O. Munagi, Apr 11 2005

References

  • Chu, Hung Viet. "Various Sequences from Counting Subsets." Fib. Quart., 59:2 (May 2021), 150-157.

Crossrefs

Programs

  • Magma
    A077868:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+, j+1): j in [0..Floor((n+1)/3)]]) >;
    [A077868(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(4, (i,j)-> if i=j-1 then 1 elif j=1 then [2,-1,1,-1][i] else 0 fi)^n)[1,1]: seq(a(n), n=0..41); # Alois P. Heinz, Sep 05 2008
    g:=(1+z+z^2)/(1-z-z^3): gser:=series(g, z=0, 43): seq(coeff(gser, z, n)-1, n=1..42); # Zerinvary Lajos, Jan 09 2009
  • Mathematica
    LinearRecurrence[{1,1,0,0,-1}, {1,2,3,5,8,12}, 42] (* or *)
    CoefficientList[Series[1/((1-x)(1-x-x^3)), {x, 0, 41}], x] (* Michael De Vlieger, Jun 06 2018 *)
  • PARI
    Vec(1/(1-x)/(1-x-x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    {a = vector(50);
    a[1] = 1; a[2] = 2; a[3] = 3;
    for(n=4,50,
    a[n] = 1 + a[n-1] + a[n-3];
    ); a} \\ Gerry Martens, Jun 03 2018
    
  • PARI
    {a(n) = if( n<0, n=-4-n; polcoeff( -1 / (1 - x) / (1 + x^2 - x^3) + x * O(x^n), n), polcoeff( 1 / (1 - x) / (1 - x - x^3) + x * O(x^n), n))}; /* Michael Somos, Jun 17 2018 */
    
  • SageMath
    def A077868(n): return sum(binomial(n-2*j+1, j+1) for j in (0..((n+1)//3)))
    [A077868(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

Partial sums of A000930. a(n-1) = Sum_{k=0..floor(n/2)} binomial(n-2*k, k+1). - Paul Barry, Jul 07 2004
a(n-3) = Sum(binomial(n-r, r)), r=1, 2, ... which is the case t=3 and k=2 in the general case of t-strings and k blocks: a(n-3, k, t) = Sum(binomial(n-r*(t-1), r)*S2(n-r*(t-1)-1, k-1)), r=1, 2, ... - Augustine O. Munagi, Apr 11 2005
From Paul Weisenhorn, Oct 28 2011: (Start)
a(n) = a(n-1) + a(n-2) - a(n-5) for n > 4.
a(n) = a(n-2) + a(n-3) + a(n-4) + 2 for n > 3.
G.f.: 1/((1-x)*(1-x-x^3)). (End)
a(n) = 1 + a(n-1) + a(n-3), a(1)=1, a(2)=2, a(3)=3. - Gerry Martens, Jun 10 2018
a(n) = -A077888(-4-n) for all n in Z. - Michael Somos, Jun 17 2018
a(n) = A000930(n+3) - 1. - Greg Dresden, Jun 20 2021
a(n) = A099567(n+3, 4). - G. C. Greubel, Jul 27 2022

Extensions

More terms from Augustine O. Munagi, Apr 11 2005

A077961 Expansion of 1 / (1 + x^2 - x^3) in powers of x.

Original entry on oeis.org

1, 0, -1, 1, 1, -2, 0, 3, -2, -3, 5, 1, -8, 4, 9, -12, -5, 21, -7, -26, 28, 19, -54, 9, 73, -63, -64, 136, 1, -200, 135, 201, -335, -66, 536, -269, -602, 805, 333, -1407, 472, 1740, -1879, -1268, 3619, -611, -4887, 4230, 4276, -9117, -46, 13393, -9071, -13439, 22464, 4368, -35903, 18096, 40271, -53999
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Examples

			G.f. = 1 - x^2 + x^3 + x^4 - 2*x^5 + 3*x^7 - 2*x^8 - 3*x^9 + 5*x^10 + x^11 + ...
		

Crossrefs

Programs

  • Magma
    I:=[1,0,-1]; [n le 3 select I[n] else -Self(n-2) +Self(n-3): n in [1..70]]; // G. C. Greubel, Mar 28 2024
    
  • Maple
    a:= n-> (<<0|1|0>, <-1|0|1>, <1|0|0>>^n)[1, 1]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Jun 20 2008
  • Mathematica
    a[ n_] := If[ n >= 0, SeriesCoefficient[ 1 / (1 + x^2 - x^3), {x, 0, n}], SeriesCoefficient[ x^3 / (1 - x - x^3), {x, 0, -n}]] (* Michael Somos, Jan 08 2014 *)
  • PARI
    {a(n) = if( n<0, polcoeff( x^3 / (1 - x - x^3) + x * O(x^-n), -n), polcoeff( 1 / (1 + x^2 - x^3) + x * O(x^n), n))} /* Michael Somos, Jan 08 2014 */
    
  • SageMath
    [sum((-1)^(n+k)*binomial(k,n-2*k) for k in range(1+n//2)) for n in range(71)] # G. C. Greubel, Mar 28 2024

Formula

a(n) = Sum_{k=0..floor(n/2)} (-1)^(n-k)*binomial(k, n-2*k). - Paul Barry, Jun 24 2005
From Alois P. Heinz, Jun 20 2008: (Start)
a(n) = term (1,1) in matrix [0,1,0; -1,0,1; 1,0,0]^n.
a(n) = A000930 (-3-n). (End)
a(-n) = A078012(n). - Michael Somos, May 03 2011
From Michael Somos, Jan 08 2014: (Start)
a(-n) = A135851(n+2).
a(n)^2 - a(n-1)*a(n+1) = A135851(n+5). (End)
G.f.: Q(0)/2 , where Q(k) = 1 + 1/(1 - x^2*(4*k+1 - x )/( x^2*(4*k+3 - x ) - 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 09 2013
a(n)^2 + a(n-1)^2 + a(n-6)^2 = a(n-2)^2 + 3*a(n-3)^2 + a(n-4)^2 + a(n-5)^2. - Greg Dresden, Apr 12 2025

A144903 Square array A(n,k), n>=0, k>=0, read by antidiagonals, where column k is the expansion of x/((1-x-x^3)*(1-x)^(k-1)).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 1, 1, 0, 1, 3, 3, 2, 1, 0, 1, 4, 6, 5, 3, 1, 0, 1, 5, 10, 11, 8, 4, 2, 0, 1, 6, 15, 21, 19, 12, 6, 3, 0, 1, 7, 21, 36, 40, 31, 18, 9, 4, 0, 1, 8, 28, 57, 76, 71, 49, 27, 13, 6, 0, 1, 9, 36, 85, 133, 147, 120, 76, 40, 19, 9, 0, 1, 10, 45, 121, 218, 280, 267, 196, 116, 59, 28, 13
Offset: 0

Views

Author

Alois P. Heinz, Sep 24 2008

Keywords

Examples

			Square array (A(n,k)) begins:
  0, 0,  0,  0,  0,   0,   0 ... A000004;
  1, 1,  1,  1,  1,   1,   1 ... A000012;
  0, 1,  2,  3,  4,   5,   6 ... A001477;
  0, 1,  3,  6, 10,  15,  21 ... A000217;
  1, 2,  5, 11, 21,  36,  57 ... A050407;
  1, 3,  8, 19, 40,  76, 133 ... ;
  1, 4, 12, 31, 71, 147, 200 ... A027658;
Antidiagonal triangle (T(n,k)) begins as:
  0;
  0,  1;
  0,  1,  0;
  0,  1,  1,  0;
  0,  1,  2,  1,  1;
  0,  1,  3,  3,  2,  1;
  0,  1,  4,  6,  5,  3,  1;
  0,  1,  5, 10, 11,  8,  4,  2;
  0,  1,  6, 15, 21, 19, 12,  6,  3;
		

Crossrefs

Rows 0-4, 6 give: A000004, A000012, A001477, A000217, A050407(n+3), A027658.
Columns 0-9 give: A078012 and A135851(n+2), A078012(n+2) and A135851(n+4), A077868(n-1) for n>0, A050228(n-1) for n>0, A226405, A144898, A144899, A144900, A144901, A144902.
Main diagonal gives: A144904.
Cf. A000930.

Programs

  • Magma
    A000930:= func< n | (&+[Binomial(n-2*j,j): j in [0..Floor(n/3)]]) >;
    A144903:= func< n,k | k eq 0 select 0 else (&+[Binomial(n-k+j-2,j)*A000930(k-j-1) : j in [0..k-1]]) >;
    [A144903(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Aug 01 2022
    
  • Maple
    A:= proc(n,k) coeftayl (x/ (1-x-x^3)/ (1-x)^(k-1), x=0, n) end:
    seq(seq(A(n, d-n), n=0..d), d=0..13);
  • Mathematica
    (* First program *)
    a[n_, k_] := SeriesCoefficient[x/((1-x-x^3)*(1-x)^(k-1)), {x, 0, n}];
    Table[a[n-k, k], {n,0,12}, {k,n,0,-1}]//Flatten (* Jean-François Alcover, Jan 15 2014 *)
    (* Second Program *)
    A000930[n_]:= A000930[n]= Sum[Binomial[n-2*j,j], {j,0,Floor[n/3]}];
    T[n_, k_]:= T[n, k]= If[k==0, 0, Sum[Binomial[n-k+j-2,j]*A000930[k-j-1], {j,0,k- 1}]];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Aug 01 2022 *)
  • SageMath
    def A000930(n): return sum(binomial(n-2*j,j) for j in (0..(n//3)))
    def A144903(n,k):
        if (k==0): return 0
        else: return sum(binomial(n-k+j-2,j)*A000930(k-j-1) for j in (0..k-1))
    flatten([[A144903(n,k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Aug 01 2022

Formula

G.f. of column k: x/((1-x-x^3)*(1-x)^(k-1)).
A(n, n) = A144904(n).
From G. C. Greubel, Aug 01 2022: (Start)
A(n, k) = Sum_{j=0..n-1} binomial(k+j-2, j)*A000930(n-j-1), with A(0, k) = 0.
T(n, k) = Sum_{j=0..k-1} binomial(n-k-j-2, j)*A000930(k-j-1), with T(n, 0) = 0.
T(2*n, n) = A144904(n). (End)

A050228 a(n) is the number of subsequences {s(k)} of {1,2,3,...n} such that s(k+1)-s(k) is 1 or 3.

Original entry on oeis.org

1, 3, 6, 11, 19, 31, 49, 76, 116, 175, 262, 390, 578, 854, 1259, 1853, 2724, 4001, 5873, 8617, 12639, 18534, 27174, 39837, 58396, 85596, 125460, 183884, 269509, 394999, 578914, 848455, 1243487, 1822435, 2670925, 3914448, 5736920, 8407883
Offset: 1

Views

Author

John W. Layman, Dec 20 1999

Keywords

Comments

The second differences c(n) of {a(n)} satisfy c(n)=c(n-1)+c(n-3) and give A000930 with the first 5 terms deleted.
Partial sums of A077868. - Paul Barry, Sep 16 2004

References

  • Chu, Hung Viet. "Various Sequences from Counting Subsets." Fib. Quart., 59:2 (May 2021), 150-157.

Crossrefs

Programs

  • Magma
    A050228:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+1, j+2): j in [0..Floor((n+1)/3)]]) >;
    [A050228(n): n in [1..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    with(combstruct): SubSetSeqU := [T, {T=Subst(U,U), S=Set(U, card>=3), U=Sequence(Z, card>=3)}, unlabeled]: seq(count(SubSetSeqU, size=n), n=9..46); # Zerinvary Lajos, Mar 18 2008
  • Mathematica
    Rest[CoefficientList[Series[1/((1-x)^2*(1-x-x^3)), {x, 0, 50}], x]] (* G. C. Greubel, Apr 27 2017 *)
    LinearRecurrence[{3,-3,2,-2,1},{1,3,6,11,19},50] (* Harvey P. Dale, Apr 21 2020 *)
  • PARI
    my(x='x+O('x^50)); Vec(x/((1-x)^3-x^3*(1-x)^2)) \\ G. C. Greubel, Apr 27 2017
    
  • SageMath
    def A050228(n): return sum(binomial(n-2*j+1, j+2) for j in (0..((n+1)//3)))
    [A050228(n) for n in (1..40)] # G. C. Greubel, Jul 27 2022

Formula

From Paul Barry, Sep 16 2004: (Start)
G.f.: x/((1-x)^3 - x^3(1-x)^2).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) - 2*a(n-4) + a(n-5).
a(n-1) = Sum_{k=0..floor(n/3)} binomial(n-2*k, k+2). (End)
G.f. = 1/((1-x)^2*(1-x-x^3)). - N. J. A. Sloane, Jun 02 2021
a(n) = A000930(n+5) - n - 4. - Greg Dresden, Jun 20 2021
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+1)/3)} binomial(n-2*j+1, j+2).
a(n) = A099567(n+1, 2). (End)

A144898 Expansion of x/((1-x-x^3)*(1-x)^4).

Original entry on oeis.org

0, 1, 5, 15, 36, 76, 147, 267, 463, 775, 1262, 2011, 3150, 4867, 7438, 11268, 16951, 25358, 37766, 56047, 82945, 122482, 180553, 265798, 390880, 574358, 843432, 1237966, 1816384, 2664311, 3907237, 5729077, 8399372, 12313154, 18049371, 26456513, 38778103
Offset: 0

Views

Author

Alois P. Heinz, Sep 24 2008

Keywords

Crossrefs

Programs

  • Magma
    A144898:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+3, j+4): j in [0..Floor((n+3)/3)]]) >;
    [A144898(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(7, (i, j)-> if i=j-1 then 1 elif j=1 then [5, -10, 11, -9, 7, -4, 1][i] else 0 fi)^n)[1, 2]: seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[ x/((1-x-x^3)(1-x)^4), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 06 2013 *)
  • SageMath
    def A144898(n): return sum(binomial(n-2*j+3, j+4) for j in (0..((n+3)//3)))
    [A144898(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

G.f.: x/((1-x-x^3)*(1-x)^4).
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+3)/3)} binomial(n-2*j+3, j+4).
a(n) = A099567(n+3, 4). (End)

A144899 Expansion of x/((1-x-x^3)*(1-x)^5).

Original entry on oeis.org

0, 1, 6, 21, 57, 133, 280, 547, 1010, 1785, 3047, 5058, 8208, 13075, 20513, 31781, 48732, 74090, 111856, 167903, 250848, 373330, 553883, 819681, 1210561, 1784919, 2628351, 3866317, 5682701, 8347012, 12254249, 17983326, 26382698, 38695852, 56745223, 83201736
Offset: 0

Views

Author

Alois P. Heinz, Sep 24 2008

Keywords

Crossrefs

Programs

  • Magma
    A144899:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+4, j+5): j in [0..Floor((n+4)/3)]]) >;
    [A144899(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(8, (i, j)-> if i=j-1 then 1 elif j=1 then [6, -15, 21, -20, 16, -11, 5, -1][i] else 0 fi)^n)[1, 2]: seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[x/((1-x-x^3)(1-x)^5), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 06 2013 *)
  • SageMath
    def A144899(n): return sum(binomial(n-2*j+4, j+5) for j in (0..((n+4)//3)))
    [A144899(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

G.f.: x/((1-x-x^3)*(1-x)^5).
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+4)/3)} binomial(n-2*j+4, j+5).
a(n) = A099567(n+4, 5). (End)

A226405 Expansion of x/((1-x-x^3)*(1-x)^3).

Original entry on oeis.org

0, 1, 4, 10, 21, 40, 71, 120, 196, 312, 487, 749, 1139, 1717, 2571, 3830, 5683, 8407, 12408, 18281, 26898, 39537, 58071, 85245, 125082, 183478, 269074, 394534, 578418, 847927, 1242926, 1821840, 2670295, 3913782, 5736217, 8407142, 12321590, 18058510, 26466393
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2013

Keywords

Comments

From Bruno Berselli, Jun 07 2013: (Start)
A050228(n) = a(n) -a(n-1), n>0.
A077868(n-1)= a(n) -2*a(n-1) +a(n-2), n>1.
A000217(n) = a(n) -a(n-1) -a(n-3), n>2.
A000930(n-1)= a(n) -3*a(n-1) +3*a(n-2) -a(n-3), n>2.
n = a(n) -2*a(n-1) +a(n-2) -a(n-3) +a(n-4), n>3.
1 = a(n) -3*a(n-1) +3*a(n-2) -2*a(n-3) +2*a(n-4) -a(n-5), n>4.
0 = a(n) -4*a(n-1) +6*a(n-2) -5*a(n-3) +4*a(n-4) -3*a(n-5) +a(n-6), n>5.
(End)

Crossrefs

Programs

  • Magma
    A226405:= func< n | n eq 0 select 0 else (&+[Binomial(n-2*j+2, j+3): j in [0..Floor((n+2)/3)]]) >;
    [A226405(n): n in [0..40]]; // G. C. Greubel, Jul 27 2022
    
  • Maple
    a:= n-> (Matrix(6, (i, j)-> if i=j-1 then 1 elif j=1 then [4, -6, 5, -4, 3, -1][i] else 0 fi)^n)[1, 2]: seq(a(n), n=0..40);
  • Mathematica
    LinearRecurrence[{4,-6,5,-4,3,-1}, {0,1,4,10,21,40}, 40]  (* Bruno Berselli, Jun 07 2013 *)
    CoefficientList[Series[x/((1-x-x^3)*(1-x)^3), {x, 0, 50}], x] (* G. C. Greubel, Apr 28 2017 *)
  • PARI
    my(x='x+O('x^50)); Vec(x/((1-x-x^3)*(1-x)^3)) \\ G. C. Greubel, Apr 28 2017
    
  • SageMath
    def A226405(n): return sum(binomial(n-2*j+2, j+3) for j in (0..((n+2)//3)))
    [A226405(n) for n in (0..40)] # G. C. Greubel, Jul 27 2022

Formula

G.f.: x/((1-x-x^3)*(1-x)^3).
From G. C. Greubel, Jul 27 2022: (Start)
a(n) = Sum_{j=0..floor((n+2)/3)} binomial(n-2*j+2, j+3).
a(n) = A099567(n+2, 3). (End)

A107458 Expansion of g.f.: (1-x^2-x^3)/( (1+x)*(1-x-x^3) ).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 1, 1, 2, 2, 4, 5, 8, 11, 17, 24, 36, 52, 77, 112, 165, 241, 354, 518, 760, 1113, 1632, 2391, 3505, 5136, 7528, 11032, 16169, 23696, 34729, 50897, 74594, 109322, 160220, 234813, 344136, 504355, 739169, 1083304, 1587660, 2326828, 3410133, 4997792, 7324621
Offset: 0

Views

Author

N. J. A. Sloane, Mar 08 2008

Keywords

Comments

The sequence can be interpreted as the top-left entry of the n-th power of a 4 X 4 (0,1) matrix. There are 12 different choices (out of 2^16) for that (0,1) matrix. - R. J. Mathar, Mar 19 2014

Crossrefs

Programs

  • GAP
    a:=[1,0,0,0];; for n in [5..50] do a[n]:=a[n-2]+a[n-3]+a[n-4]; od; a; # G. C. Greubel, Jan 03 2020
  • Haskell
    a107458 n = a107458_list !! n
    a107458_list = 1 : 0 : 0 : 0 : zipWith (+) a107458_list
       (zipWith (+) (tail a107458_list) (drop 2 a107458_list))
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!(1-x^2-x^3)/( (1+x)*(1-x-x^3))); // Marius A. Burtea, Jan 02 2020
    
  • Maple
    seq(coeff(series( (1-x^2-x^3)/( (1+x)*(1-x-x^3) ), x, n+1), x, n), n = 0..50); # G. C. Greubel, Jan 03 2020
  • Mathematica
    CoefficientList[Series[(1-x^2-x^3)/(1-x^2-x^3-x^4),{x,0,50}],x] (* or *) LinearRecurrence[{0,1,1,1},{1,0,0,0},50] (* Harvey P. Dale, Jun 20 2011 *)
  • PARI
    my(x='x+O('x^50)); Vec((1-x^2-x^3)/((1+x)*(1-x-x^3))) \\ G. C. Greubel, Apr 27 2017
    
  • Sage
    def A107458_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( (1-x^2-x^3)/((1+x)*(1-x-x^3)) ).list()
    A107458_list(50) # G. C. Greubel, Jan 03 2020
    

Formula

a(n) = a(n-2) + a(n-3) + a(n-4); a(0)=1, a(1)=0, a(2)=0, a(3)=0. - Harvey P. Dale, Jun 20 2011
a(n) + a(n-1) = A000930(n-4). - R. J. Mathar, Mar 19 2014
Showing 1-9 of 9 results.