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

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

A071675 Array read by antidiagonals of trinomial coefficients.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 0, 3, 3, 1, 0, 0, 2, 6, 4, 1, 0, 0, 1, 7, 10, 5, 1, 0, 0, 0, 6, 16, 15, 6, 1, 0, 0, 0, 3, 19, 30, 21, 7, 1, 0, 0, 0, 1, 16, 45, 50, 28, 8, 1, 0, 0, 0, 0, 10, 51, 90, 77, 36, 9, 1, 0, 0, 0, 0, 4, 45, 126, 161, 112, 45, 10, 1, 0, 0, 0, 0, 1, 30, 141, 266, 266
Offset: 0

Views

Author

Henry Bottomley, May 30 2002

Keywords

Comments

Read as a number triangle, this is the Riordan array (1, x(1+x+x^2)) with T(n,k) = Sum_{i=0..floor((n+k)/2)} C(k,2i+2k-n)*C(2i+2k-n,i). Rows start {1}, {0,1}, {0,1,1}, {0,1,2,1}, {0,0,3,3,1},... Row sums are then the trinomial numbers A000073(n+2). Diagonal sums are A013979. - Paul Barry, Feb 15 2005
Let {a_(k,i)}, k>=1, i=0,...,k, be the k-th antidiagonal of the array. Then s_k(n)=sum{i=0,...,k}a_(k,i)* binomial(n,k) is the n-th element of the k-th column of A213742. For example, s_1(n)=binomial(n,1)=n is the first column of A213742 for n>1, s_2(n)=binomial(n,1)+binomial(n,2)is the second column of A213742 for n>1, etc. In particular (see comment in A213742) in cases k=4,5,6,7,8, s_k(n) is A005718(n+2), A005719(n), A005720(n), A001919(n), A064055(n+3), respectively. - Vladimir Shevelev and Peter J. C. Moses, Jun 22 2012

Examples

			Rows start
1, 0,  0,  0,  0,  0, ...;
1, 1,  1,  0,  0,  0,  0, ...;
1, 2,  3,  2,  1,  0,  0, ...;
1, 3,  6,  7,  6,  3,  1, 0, ...;
1, 4, 10, 16, 19, 16, 10, 4, 1, ...; etc.
		

Crossrefs

Visible version of A027907. Row sums are 3^n, i.e. A000244. Central diagonal is A002426. Cf. A071676 for a slight variation.

Programs

  • Mathematica
    T[n_, k_] := Sum[Binomial[n - k - j, j]*Binomial[k, n - k - j], {j, 0,
    Floor[(n - k)/2]}]; Table[T[n, k], {n,0,10}, {k,0,n}] // Flatten (* G. C. Greubel, Feb 28 2017 *)

Formula

T(n, k) = T(n-1, k) + T(n-1, k-1) + T(n-1, k-2) starting with T(0, 0)=1. See A027907 for more.
As a number triangle, T(n, k) = Sum_{i=0..floor((n-k)/2)} C(n-k-i, i) * C(k, n-k-i). - Paul Barry, Apr 26 2005

A111006 Another version of Fibonacci-Pascal triangle A037027.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 0, 2, 3, 0, 0, 1, 5, 5, 0, 0, 0, 3, 10, 8, 0, 0, 0, 1, 9, 20, 13, 0, 0, 0, 0, 4, 22, 38, 21, 0, 0, 0, 0, 1, 14, 51, 71, 34, 0, 0, 0, 0, 0, 5, 40, 111, 130, 55, 0, 0, 0, 0, 0, 1, 20, 105, 233, 235, 89, 0, 0, 0, 0, 0, 0, 6, 65, 256, 474, 420, 144
Offset: 0

Views

Author

Philippe Deléham, Oct 02 2005

Keywords

Comments

Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...] DELTA [1, 1, -1, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.
Row sums are the Jacobsthal numbers A001045(n+1) and column sums form Pell numbers A000129.
Maximal column entries: A038149 = {1, 1, 2, 5, 10, 22, ...}.
T(n,k) gives a convolved Fibonacci sequence (A001629, A001872, ...).
Triangle read by rows: T(n,n-k) is the number of ways to tile a 2 X n rectangle with k pieces of 2 X 2 tiles and n-2k pieces of 1 X 2 tiles (0 <= k <= floor(n/2)). - Philippe Deléham, Feb 17 2014
Diagonal sums are A013979(n). - Philippe Deléham, Feb 17 2014
T(n,k) is the number of ways to tile a 2 X n rectangle with k pieces of 2 X 2 tiles and 1 X 2 tiles. - Emeric Deutsch, Aug 14 2014

Examples

			Triangle begins:
  1;
  0, 1;
  0, 1, 2;
  0, 0, 2, 3;
  0, 0, 1, 5,  5;
  0, 0, 0, 3, 10,  8;
  0, 0, 0, 1,  9, 20, 13;
  0, 0, 0, 0,  4, 22, 38,  21;
  0, 0, 0, 0,  1, 14, 51,  71,  34;
  0, 0, 0, 0,  0,  5, 40, 111, 130,  55;
  0, 0, 0, 0,  0,  1, 20, 105, 233, 235,  89;
  0, 0, 0, 0,  0,  0,  6,  65, 256, 474, 420, 144;
		

Crossrefs

Cf. A000045, A000129, A001045, A037027, A038112, A038149, A084938, A128100 (reversed version).
Some other Fibonacci-Pascal triangles: A027926, A036355, A037027, A074829, A105809, A109906, A114197, A162741, A228074.

Programs

  • Haskell
    a111006 n k = a111006_tabl !! n !! k
    a111006_row n = a111006_tabl !! n
    a111006_tabl =  map fst $ iterate (\(us, vs) ->
       (vs, zipWith (+) (zipWith (+) ([0] ++ us ++ [0]) ([0,0] ++ us))
                        ([0] ++ vs))) ([1], [0,1])
    -- Reinhard Zumkeller, Aug 15 2013

Formula

T(0, 0) = 1, T(n, k) = 0 for k < 0 or for n < k, T(n, k) = T(n-1, k-1) + T(n-2, k-1) + T(n-2, k-2).
T(n, k) = A037027(k, n-k). T(n, n) = A000045(n+1). T(3n, 2n) = (n+1)*A001002(n+1) = A038112(n).
G.f.: 1/(1-yx(1-x)-x^2*y^2). - Paul Barry, Oct 04 2005
Sum_{k=0..n} x^k*T(n,k) = (-1)^n*A053524(n+1), (-1)^n*A083858(n+1), (-1)^n*A002605(n), A033999(n), A000007(n), A001045(n+1), A083099(n) for x = -4, -3, -2, -1, 0, 1, 2 respectively. - Philippe Deléham, Dec 02 2006
Sum_{k=0..n} T(n,k)*x^(n-k) = A053404(n), A015447(n), A015446(n), A015445(n), A015443(n), A015442(n), A015441(n), A015440(n), A006131(n), A006130(n), A001045(n+1), A000045(n+1) for x = 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 respectively. - Philippe Deléham, Feb 17 2014

A060945 Number of compositions (ordered partitions) of n into 1's, 2's and 4's.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 18, 31, 55, 96, 169, 296, 520, 912, 1601, 2809, 4930, 8651, 15182, 26642, 46754, 82047, 143983, 252672, 443409, 778128, 1365520, 2396320, 4205249, 7379697, 12950466, 22726483, 39882198, 69988378, 122821042, 215535903, 378239143, 663763424, 1164823609
Offset: 0

Views

Author

Len Smiley, May 07 2001

Keywords

Comments

Diagonal sums of A038137. - Paul Barry, Oct 24 2005
From Gary W. Adamson, Oct 28 2010: (Start)
INVERT transform of the aerated Fibonacci sequence (1, 0, 1, 0, 2, 0, 3, 0, 5, ...).
a(n) = term (4,4) in the n-th power of the matrix [0,1,0,0; 0,0,1,0; 0,0,0,1; 1,0,1,1]. (End)
Number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=1, r=3, I={2}. - Vladimir Baltic, Mar 07 2012
Number of compositions of n if the summand 2 is frozen in place or equivalently, if the ordering of the summand 2 does not count. - Gregory L. Simay, Jul 18 2016
a(n) - a(n-2) = number of compositions of n with no 2's = A005251(n+1). - Gregory L. Simay, Jul 18 2016
In general, the number of compositions of n with summand k frozen in place is equal to the number of compositions of n with only summands 1,...,k,2k. - Gregory L. Simay, May 10 2017
In the same way that the sum of any two alternating terms of A006498 produces a term from A000045 (the Fibonacci sequence), so it could be thought of as a "meta-Fibonacci," and the sum of any two alternating terms of A013979 produces a term from A000930 (Narayana’s cows), so it could analogously be called "meta-Narayana’s cows," this sequence embeds (can generate) A000931 (the Padovan sequence), as the odd terms of A000931 are generated by the sum of successive elements (e.g. 1+2=3, 2+3=5, 3+6=9, 6+10=16) and its even terms are generated by the difference of "supersuccessive" (second-order successive or "alternating," separated by a single other term) terms (e.g. 10-3=7, 18-6=12, 31-10=21, 55-18=37) — or, equivalently, adding "supersupersuccessive" terms (separated by 2 other terms, e.g. 1+6=7, 2+10=12, 3+18=21, 6+31=37) — so it could be dubbed the "metaPadovan." - Michael Cohen and Yasuyuki Kachi, Jun 13 2024

Examples

			There are 18=a(6) compositions of 6 with the summand 2 frozen in place: (6), (51), (15), (4[2]), (33), (411), (141), (114), (3[2]1), (1[2]3), ([222]), (3111), (1311), (1131), (1113), ([22]11), ([2]1111), (111111). Equivalently, the position of the summand 2 does not affect the composition count. For example, (321)=(231)=(312) and (123)=(213)=(132).
		

Crossrefs

Cf. A000045 (1's and 2's only), A023359 (all powers of 2)
Same as unsigned version of A077930.
All of A060945, A077930, A181532 are variations of the same sequence. - N. J. A. Sloane, Mar 04 2012

Programs

  • Haskell
    a060945 n = a060945_list !! (n-1)
    a060945_list = 1 : 1 : 2 : 3 : 6 : zipWith (+) a060945_list
       (zipWith (+) (drop 2 a060945_list) (drop 3 a060945_list))
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Magma
    R:=PowerSeriesRing(Integers(), 40);
    Coefficients(R!( 1/(1-x-x^2-x^4) )); // G. C. Greubel, Apr 09 2021
    
  • Maple
    m:= 40; S:= series( 1/(1-x-x^2-x^4), x, m+1);
    seq(coeff(S, x, j), j = 0..m); # G. C. Greubel, Apr 09 2021
  • Mathematica
    LinearRecurrence[{1,1,0,1}, {1,1,2,3}, 39] (* or *)
    CoefficientList[Series[1/(1-x-x^2-x^4), {x, 0, 38}], x] (* Michael De Vlieger, May 10 2017 *)
  • PARI
    N=66; my(x='x+O('x^N));
    Vec(1/(1-x-x^2-x^4))
    /* Joerg Arndt, Oct 21 2012 */
    
  • Sage
    def A060945_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( 1/(1-x-x^2-x^4) ).list()
    A060945_list(40) # G. C. Greubel, Apr 09 2021

Formula

a(n) = a(n-1) + a(n-2) + a(n-4).
G.f.: 1 / (1 - x - x^2 - x^4).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..n-k} C(i, n-k-i)*C(2*i-n+k, 3*k-2*n+2*i). - Paul Barry, Oct 24 2005
a(2n) = A238236(n), a(2n+1) = A097472(n). - Philippe Deléham, Feb 20 2014
a(n) + a(n+1) = A005314(n+2). - R. J. Mathar, Jun 17 2020

Extensions

a(0) = 1 prepended by Joerg Arndt, Oct 21 2012

A135851 a(n) = n-1, if n <= 2, otherwise A107458(n-1) + A107458(n-2).

Original entry on oeis.org

-1, 0, 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, Mar 08 2008

Keywords

Examples

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

Crossrefs

Programs

  • Haskell
    a135851 n = a135851_list !! n
    a135851_list = -1 : 0 : 1 : zipWith (+) a135851_list (drop 2 a135851_list)
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Magma
    [n le 3 select n-2 else Self(n-1) + Self(n-3): n in [1..61]]; // G. C. Greubel, Aug 01 2022
    
  • Mathematica
    LinearRecurrence[{1,0,1},{-1,0,1},50] (* Vladimir Joseph Stephan Orlovsky, Jan 31 2012 *)
    a[ n_] := If[ n < 3, SeriesCoefficient[ 1 / (1 + x^2 - x^3), {x, 0, 2 - n}], SeriesCoefficient[ x^5 / (1 - x - x^3), {x, 0, n}]]; (* Michael Somos, Jan 08 2014 *)
  • PARI
    {a(n) = if( n<3, polcoeff( 1 / (1 + x^2 - x^3) + x * O(x^(2-n)), 2-n), polcoeff( x^5 / (1 - x - x^3) + x * O(x^n), n))}; /* Michael Somos, Jan 08 2014 */
    
  • SageMath
    def A000930(n): return sum(binomial(n-2*j,j) for j in (0..(n//3)))
    def A135851(n): return A000930(n+2) -2*A000930(n)
    [A135851(n) for n in (0..60)] # G. C. Greubel, Aug 01 2022

Formula

From R. J. Mathar, Jul 26 2010: (Start)
a(n) = +a(n-1) +a(n-3).
a(n) = A078012(n-2), for n>=2.
G.f.: (-1 + x + x^2) / (1 - x - x^3). (End)
From Michael Somos, Jan 08 2014: (Start)
a(n) = A077961(2-n) for all n in Z.
a(n)^2 - a(n-1)*a(n+1) = A077961(n-5). (End)
a(n) = A000930(n+2) - 2*A000930(n). - G. C. Greubel, Aug 01 2022

A001634 a(n) = a(n-2) + a(n-3) + a(n-4), with initial values a(0) = 0, a(1) = 2, a(2) = 3, a(3) = 6.

Original entry on oeis.org

0, 2, 3, 6, 5, 11, 14, 22, 30, 47, 66, 99, 143, 212, 308, 454, 663, 974, 1425, 2091, 3062, 4490, 6578, 9643, 14130, 20711, 30351, 44484, 65192, 95546, 140027, 205222, 300765, 440795, 646014, 946782, 1387574, 2033591, 2980370, 4367947, 6401535, 9381908
Offset: 0

Views

Author

Keywords

References

  • E.-B. Escott, Reply to Query 1484, L'Intermédiaire des Mathématiciens, 8 (1901), 63-64.
  • 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).

Crossrefs

Programs

  • Haskell
    a001634 n = a001634_list !! n
    a001634_list = 0 : 2 : 3 : 6 : zipWith (+) a001634_list
       (zipWith (+) (tail a001634_list) (drop 2 a001634_list))
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Maple
    A001634:=-z*(2+3*z+4*z**2)/(1+z)/(z**3+z-1); # Simon Plouffe in his 1992 dissertation
    a:= n-> (Matrix([[0,4,-1,-1]]). Matrix(4, (i,j)-> if (i=j-1) then 1 elif j=1 then [0,1,1,1][i] else 0 fi)^n)[1,1]: seq(a(n), n=0..40); # Alois P. Heinz, Aug 01 2008
  • Mathematica
    LinearRecurrence[{0, 1, 1, 1}, {0, 2, 3, 6}, 100] (* Vladimir Joseph Stephan Orlovsky, Jul 01 2011 *)
    CoefficientList[Series[x (2+3x+4x^2)/(1-x^2-x^3-x^4),{x,0,50}],x] (* Harvey P. Dale, Mar 26 2023 *)
  • Maxima
    a(n):=(sum(sum(binomial(j,n-2*k-j-1)*binomial(k+1,j),j,0,k+1)/(k+1),k,0,(n-1)/2))*(n+1); /* Vladimir Kruchinin, Mar 22 2016 */
  • PARI
    a(n)=if(n<0,0,polcoeff(x*(2+3*x+4*x^2)/(1-x^2-x^3-x^4)+x*O(x^n),n))
    

Formula

G.f.: x(2 + 3x + 4x^2)/(1 - x^2 - x^3 - x^4).
a(n) = Sum_{k=0..(n-1)/2}(Sum_{j=0..k+1}(binomial(j,n-2*k-j-1)*binomial(k+1,j))/(k+1))*(n+1). - Vladimir Kruchinin, Mar 22 2016

A023435 Dying rabbits: a(n) = a(n-1) + a(n-2) - a(n-5).

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 7, 11, 16, 24, 35, 52, 76, 112, 164, 241, 353, 518, 759, 1113, 1631, 2391, 3504, 5136, 7527, 11032, 16168, 23696, 34728, 50897, 74593, 109322, 160219, 234813, 344135, 504355, 739168, 1083304, 1587659, 2326828, 3410132, 4997792, 7324620, 10734753
Offset: 0

Views

Author

Keywords

Comments

Diagonal sums of Riordan array (1/(1-x), x(1+x+x^2)) yield a(n+1). - Paul Barry, Feb 16 2005
The Ca2 sums, see A180662 for the definition of these sums, of the "Races with Ties" triangle A035317 lead to this sequence. - Johannes W. Meijer, Jul 20 2011
Number of ordered partitions of (n-1) into parts less than or equal to 3, where the order of the 2's is unimportant. (see example). - David Neil McGrath, Apr 26 2015
Number of ordered partitions of (n-1) into parts less than or equal to 4, where the order of the 1's is unimportant.(see example). - David Neil McGrath, May 05 2015
List the partitions of n in nonincreasing order. Freeze the 1's and 2's in place and allow the other summands to vary their order without disturbing the 1's and 2's. The result is a(n+1). - Gregory L. Simay (based on correspondence with George E. Andrews), Jul 11 2016
Number of ordered partitions of n-1 where the order of the 1's and the 2's are unimportant. - Gregory L. Simay, Jul 18 2016

Examples

			There are 11 partitions of 6 into parts less than or equal to 3, where the order of 2's is unimportant, a(7)=11. These are (33),(321=231=312),(132=123=213),(3111),(1311),(1131),(1113),(222),(2211=1122=1221=2112=2121=1212),(21111=12111=11211=11121=11112),(111111). - _David Neil McGrath_, Apr 26 2015
There are 11 partitions of 6 into parts less than equal to 4, where the order of 1's is unimportant. These are (42),(24),(411=141=114),(33),(321=312=132),(231=213=123),(3111=1311=1131=1113),(222),(2211=1122=2112=1221=1212=2121),(21111=12111=11211=11121=11112),(111111). - _David Neil McGrath_, May 05 2015
There are a(9)=24 partitions of 8 where the 1's and 2's are frozen []: (8), (7[1]), (6[2]), (53), (35) (44), (6[1][1]), (5,[2][1]), (43[1]), (34[1]), (4[2][2]), (33[2][2]) (5[1][1][1]), (4[2][1][1]), (33[1][1]), (3[2][2][1]), ([2][2][2][2]), (4[1][1][1][1]), (3[2][1][1][1]), ([2][2][2][1][1]), (3[1][1][1][1][1]), ([2][2][1][1][1][1]), ([2][1][1][1][1][1][1]),([1][1][1][1][1][1][1][1]). - _Gregory L. Simay_, Jul 11 2016
		

Crossrefs

First differences are in A013979.
Cf. A077864 (bisection).

Programs

  • Magma
    I:=[0,1,1,2,3]; [n le 5 select I[n] else Self(n-1)+Self(n-2)-Self(n-5): n in [1..45]]; // Vincenzo Librandi, Apr 27 2015
    
  • Mathematica
    LinearRecurrence[{1, 1, 0, 0, -1}, {0, 1, 1, 2, 3}, 50] (* Vincenzo Librandi, Apr 27 2015 *)
  • PARI
    x='x+O('x^99); concat(0, Vec(x/((x-1)*(1+x)*(x^3+x-1)))) \\ Altug Alkan, Apr 09 2018

Formula

G.f.: x / ( (x-1)*(1+x)*(x^3+x-1) ). - R. J. Mathar, Nov 28 2011

Extensions

More terms from Vincenzo Librandi, Apr 27 2015

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

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

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 3, 5, 5, 3, 1, 0, 1, 3, 6, 7, 6, 3, 1, 0, 1, 4, 9, 13, 13, 9, 4, 1, 0, 1, 4, 10, 16, 19, 16, 10, 4, 1, 0, 1, 5, 14, 26, 35, 35, 26, 14, 5, 1, 0, 1, 5, 15, 30, 45, 51, 45, 30, 15, 5, 1, 0, 1, 6, 20, 45, 75, 96, 96, 75, 45, 20, 6, 1, 0
Offset: 0

Views

Author

Philippe Deléham, Nov 05 2006

Keywords

Comments

A169623 is a very similar triangle except it does not have the outer diagonal of 0's. - N. J. A. Sloane, Nov 23 2017

Examples

			Triangle begins:
  1;
  1,  0;
  1,  1,  0;
  1,  1,  1,  0;
  1,  2,  2,  1,  0;
  1,  2,  3,  2,  1,  0;
  1,  3,  5,  5,  3,  1,  0;
  1,  3,  6,  7,  6,  3,  1,  0;
  1,  4,  9, 13, 13,  9,  4,  1,  0;
		

Crossrefs

Programs

  • Magma
    function T(n,k) // T = A123149
      if k lt 0 or k gt n then return 0;
      elif k eq 0 or k eq n-1 then return 1;
      elif k eq n then return 0;
      else return T(n-2,k) +T(n-2,k-1) +T(n-2,k-2);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 17 2023
    
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==0 || k==n-1, 1, If[k==n, 0, T[n-2,k] +T[n-2,k-1] +T[n-2,k-2] ]]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jul 17 2023 *)
  • SageMath
    def T(n,k): # T = A123149
        if (k<0 or k>n): return 0
        elif (k==0 or k==n-1): return 1
        elif (k==n): return 0
        else: return T(n-2,k) +T(n-2,k-1) +T(n-2,k-2)
    flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jul 17 2023

Formula

T(n,k) = T(n-1,k-1) + T(n-1,k) if n even, T(n,k) = T(n-1,k-1) + T(n-2,k) if n odd, T(0,0) = 1, T(1,0) = 1, T(1,1) = 0, T(n,k) = 0 if k < 0 or if k > n.
T(n,k) = T(n,n-k-1).
Sum_{k=0..n} T(n,k) = A038754(n-1), for n>=1.
T(2*n,n) = A005773(n).
T(2*n+1,n) = A002426(n).
From Philippe Deléham, May 04 2012: (Start)
G.f.: (1+x-y^2*x^2)/(1-x^2-y*x^2-y^2*x^2).
T(n,k) = T(n-2,k) + T(n-2,k-1) + T(n-2,k-2), T(0,0) = T(1,0) = T(2,0) = T(2,1) = 1, T(1,1) = T(2,2) = 0 and T(n,k) = 0 if k < 0 or if k > n.
Sum_{k=0..n} T(n,k) = A182522(n). (End)
From G. C. Greubel, Jul 17 2023: (Start)
Sum_{k=0..n} (-1)^k*T(n,k) = A135528(n).
Sum_{k=0..floor(n/2)} T(n-k,k) = [n==0] + A013979(n+1). (End)

A246690 Number A(n,k) of compositions of n into parts of the k-th list of distinct parts in the order given by A246688; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 2, 0, 1, 0, 1, 1, 0, 3, 1, 1, 0, 1, 0, 1, 1, 5, 0, 1, 0, 1, 1, 0, 2, 0, 8, 1, 1, 0, 1, 0, 1, 0, 3, 0, 13, 0, 1, 0, 1, 0, 1, 1, 1, 4, 1, 21, 1, 1, 0, 1, 1, 0, 1, 2, 0, 6, 0, 34, 0, 1, 0, 1, 1, 2, 0, 1, 3, 0, 9, 0, 55, 1, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Sep 01 2014

Keywords

Comments

The first lists of distinct parts in the order given by A246688 are: 0:[], 1:[1], 2:[2], 3:[1,2], 4:[3], 5:[1,3], 6:[4], 7:[1,4], 8:[2,3], 9:[5], 10:[1,2,3], 11:[1,5], 12:[2,4], 13:[6], 14:[1,2,4], 15:[1,6], 16:[2,5], 17:[3,4], 18:[7], 19:[1,2,5], 20:[1,3,4], ... .

Examples

			Square array A(n,k) begins:
  1, 1, 1,  1, 1,  1, 1,  1, 1, 1,   1, 1, 1, 1,   1, ...
  0, 1, 0,  1, 0,  1, 0,  1, 0, 0,   1, 1, 0, 0,   1, ...
  0, 1, 1,  2, 0,  1, 0,  1, 1, 0,   2, 1, 1, 0,   2, ...
  0, 1, 0,  3, 1,  2, 0,  1, 1, 0,   4, 1, 0, 0,   3, ...
  0, 1, 1,  5, 0,  3, 1,  2, 1, 0,   7, 1, 2, 0,   6, ...
  0, 1, 0,  8, 0,  4, 0,  3, 2, 1,  13, 2, 0, 0,  10, ...
  0, 1, 1, 13, 1,  6, 0,  4, 2, 0,  24, 3, 3, 1,  18, ...
  0, 1, 0, 21, 0,  9, 0,  5, 3, 0,  44, 4, 0, 0,  31, ...
  0, 1, 1, 34, 0, 13, 1,  7, 4, 0,  81, 5, 5, 0,  55, ...
  0, 1, 0, 55, 1, 19, 0, 10, 5, 0, 149, 6, 0, 0,  96, ...
  0, 1, 1, 89, 0, 28, 0, 14, 7, 1, 274, 8, 8, 0, 169, ...
		

Crossrefs

Main diagonal gives A246691.
Cf. A246688, A246720 (the same for partitions).

Programs

  • Maple
    b:= proc(n, i) b(n, i):= `if`(n=0, [[]], `if`(i>n, [],
          [map(x->[i, x[]], b(n-i, i+1))[], b(n, i+1)[]]))
        end:
    f:= proc() local i, l; i, l:=0, [];
          proc(n) while n>=nops(l)
            do l:=[l[], b(i, 1)[]]; i:=i+1 od; l[n+1]
          end
        end():
    g:= proc(n, l) option remember; `if`(n=0, 1,
          add(`if`(i>n, 0, g(n-i, l)), i=l))
        end:
    A:= (n, k)-> g(n, f(k)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, {{}}, If[i>n, {}, Join[Prepend[#, i]& /@ b[n - i, i + 1], b[n, i + 1]]]];
    f = Module[{i = 0, l = {}}, Function[n, While[n >= Length[l], l = Join[l, b[i, 1]]; i++]; l[[n + 1]]]];
    g[n_, l_] := g[n, l] = If[n==0, 1, Sum[If[i>n, 0, g[n - i, l]], {i, l}]];
    A[n_, k_] := g[n, f[k]];
    Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Dec 07 2020, after Alois P. Heinz *)
Showing 1-10 of 11 results. Next