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 31 results. Next

A059841 Period 2: Repeat [1,0]. a(n) = 1 - (n mod 2); Characteristic function of even numbers.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Alford Arnold, Feb 25 2001

Keywords

Comments

When viewed as a triangular array, the row sum values are 0 1 1 1 2 3 3 3 4 5 5 5 6 ... (A004525).
This is the r=0 member of the r-family of sequences S_r(n) defined in A092184 where more information can be found.
Successive binomial transforms of this sequence: A011782, A007051, A007582, A081186, A081187, A081188, A081189, A081190, A060531, A081192.
Characteristic function of even numbers: a(A005843(n))=1, a(A005408(n))=0. - Reinhard Zumkeller, Sep 29 2008
This sequence is the Euler transformation of A185012. - Jason Kimberley, Oct 14 2011
a(n) is the parity of n+1. - Omar E. Pol, Jan 17 2012
Read as partial sequences, we get to A000975. - Jon Perry, Nov 11 2014
Elementary Cellular Automata rule 77 produces this sequence. See Wolfram, Weisstein and Index links below. - Robert Price, Jan 30 2016
Column k = 1 of A051159. - John Keith, Jun 28 2021
When read as a constant: decimal expansion of 10/99, binary expansion of 2/3. - Jason Bard, Aug 25 2025

Examples

			Triangle begins:
  1;
  0, 1;
  0, 1, 0;
  1, 0, 1, 0;
  1, 0, 1, 0, 1;
  0, 1, 0, 1, 0, 1;
  0, 1, 0, 1, 0, 1, 0;
  1, 0, 1, 0, 1, 0, 1, 0;
  1, 0, 1, 0, 1, 0, 1, 0, 1;
  0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0;
  ...
		

Crossrefs

One's complement of A000035 (essentially the same, but shifted once).
Cf. A033999 (first differences), A008619 (partial sums), A004525, A011782 (binomial transf.), A000975.
Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), this sequence (g=2), A079978 (g=3), A121262 (g=4), A079998 (g=5), A079979 (g=6), A082784 (g=7).

Programs

  • Haskell
    a059841 n = (1 -) . (`mod` 2)
    a059841_list = cycle [1,0]
    -- Reinhard Zumkeller, May 05 2012, Dec 30 2011
    
  • Magma
    [0^(n mod 2): n in  [0..100]]; // Vincenzo Librandi, Nov 09 2014
    
  • Maple
    seq(1-modp(n,2), n=0..150); # Muniru A Asiru, Apr 05 2018
  • Mathematica
    CoefficientList[Series[1/(1 - x^2), {x, 0, 104}], x] (* or *)
    Array[1/2 + (-1)^#/2 &, 105, 0] (* Michael De Vlieger, Feb 19 2019 *)
    Table[QBinomial[n, 1, -1], {n, 1, 74}] (* John Keith, Jun 28 2021 *)
    PadRight[{},120,{1,0}] (* Harvey P. Dale, Mar 06 2023 *)
  • PARI
    a(n)=(n+1)%2; \\ or 1-n%2 as in NAME.
    
  • PARI
    A059841(n)=!bittest(n,0) \\ M. F. Hasler, Jan 13 2012
    
  • Python
    def A059841(n): return 1 - (n & 1) # Chai Wah Wu, May 25 2022

Formula

a(n) = 1 - A000035(n). - M. F. Hasler, Jan 13 2012
From Paul Barry, Mar 11 2003: (Start)
G.f.: 1/(1-x^2).
E.g.f.: cosh(x).
a(n) = (n+1) mod 2.
a(n) = 1/2 + (-1)^n/2. (End)
Additive with a(p^e) = 1 if p = 2, 0 otherwise.
a(n) = Sum_{k=0..n} (-1)^k*A038137(n, k). - Philippe Deléham, Nov 30 2006
a(n) = Sum_{k=1..n} (-1)^(n-k) for n > 0. - William A. Tedeschi, Aug 05 2011
E.g.f.: cosh(x) = 1 + x^2/(Q(0) - x^2); Q(k) = 8k + 2 + x^2/(1 + (2k + 1)*(2k + 2)/Q(k + 1)); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
E.g.f.: cosh(x) = 1/2*Q(0); Q(k) = 1 + 1/(1 - x^2/(x^2 + (2k + 1)*(2k + 2)/Q(k + 1))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
E.g.f.: cosh(x) = E(0)/(1-x) where E(k) = 1 - x/(1 - x/(x - (2*k+1)*(2*k+2)/E(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Apr 05 2013
For the general case: the characteristic function of numbers that are not multiples of m is a(n) = floor((n-1)/m) - floor(n/m) + 1, m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = A000035(n+1) = A008619(n) - A110654(n). - Wesley Ivan Hurt, Jul 20 2013

Extensions

Better definition from M. F. Hasler, Jan 13 2012
Reinhard Zumkeller's Sep 29 2008 description added as a secondary name by Antti Karttunen, May 03 2022

A008619 Positive integers repeated.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38
Offset: 0

Views

Author

Keywords

Comments

The floor of the arithmetic mean of the first n+1 positive integers. - Cino Hilliard, Sep 06 2003
Number of partitions of n into powers of 2 where no power is used more than three times, or 4th binary partition function (see A072170).
Number of partitions of n in which the greatest part is at most 2. - Robert G. Wilson v, Jan 11 2002
Number of partitions of n into at most 2 parts. - Jon Perry, Jun 16 2003
a(n) = #{k=0..n: k+n is even}. - Paul Barry, Sep 13 2003
Number of symmetric Dyck paths of semilength n+2 and having two peaks. E.g., a(6)=4 because we have UUUUUUU*DU*DDDDDDD, UUUUUU*DDUU*DDDDDD, UUUUU*DDDUUU*DDDDD and UUUU*DDDDUUUU*DDDD, where U=(1,1), D=(1,-1) and * indicates a peak. - Emeric Deutsch, Jan 12 2004
Smallest positive integer whose harmonic mean with another positive integer is n (for n > 0). For example, a(6)=4 is already given (as 4 is the smallest positive integer such that the harmonic mean of 4 (with 12) is 6) - but the harmonic mean of 2 (with -6) is also 6 and 2 < 4, so the two positive integer restrictions need to be imposed to rule out both 2 and -6.
Second outermost diagonal of Losanitsch's triangle (A034851). - Alonso del Arte, Mar 12 2006
Arithmetic mean of n-th row of A080511. - Amarnath Murthy, Mar 20 2003
a(n) is the number of ways to pay n euros (or dollars) with coins of one and two euros (respectively dollars). - Richard Choulet and Robert G. Wilson v, Dec 31 2007
Inverse binomial transform of A045623. - Philippe Deléham, Dec 30 2008
Coefficient of q^n in the expansion of (m choose 2)_q as m goes to infinity. - Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 21 2002
Binomial transform of (-1)^n*A034008(n) = [1,0,1,-2,4,-8,16,-32,...]. - Philippe Deléham, Nov 15 2009
From Jon Perry_, Nov 16 2010: (Start)
Column sums of:
1 1 1 1 1 1...
1 1 1 1...
1 1...
..............
--------------
1 1 2 2 3 3... (End)
This sequence is also the half-convolution of the powers of 1 sequence A000012 with itself. For the definition of half-convolution see a comment on A201204, where also the rule for the o.g.f. is given. - Wolfdieter Lang, Jan 09 2012
a(n) is also the number of roots of the n-th Bernoulli polynomial in the right half-plane for n>0. - Michel Lagneau, Nov 08 2012
a(n) is the number of symmetry-allowed, linearly-independent terms at n-th order in the series expansion of the Exe vibronic perturbation matrix, H(Q) (cf. Viel & Eisfeld). - Bradley Klee, Jul 21 2015
a(n) is the number of distinct integers in the n-th row of Pascal's triangle. - Melvin Peralta, Feb 03 2016
a(n+1) for n >= 3 is the diameter of the Generalized Petersen Graph G(n, 1). - Nick Mayers, Jun 06 2016
The arithmetic function v_1(n,2) as defined in A289198. - Robert Price, Aug 22 2017
Also, this sequence is the second column in the triangle of the coefficients of the sum of two consecutive Fibonacci polynomials F(n+1, x) and F(n, x) (n>=0) in ascending powers of x. - Mohammad K. Azarian, Jul 18 2018
a(n+2) is the least k such that given any k integers, there exist two of them whose sum or difference is divisible by n. - Pablo Hueso Merino, May 09 2020
Column k = 2 of A051159. - John Keith, Jun 28 2021

References

  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 100.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 109, Eq. [6c]; p. 116, P(n,2).
  • D. Parisse, 'The tower of Hanoi and the Stern-Brocot Array', Thesis, Munich 1997

Crossrefs

Essentially same as A004526.
Harmonic mean of a(n) and A056136 is n.
a(n)=A010766(n+2, 2).
Cf. A010551 (partial products).
Cf. A263997 (a block spiral).
Cf. A289187.
Column 2 of A235791.

Programs

  • Haskell
    a008619 = (+ 1) . (`div` 2)
    a008619_list = concatMap (\x -> [x,x]) [1..]
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Magma
    I:=[1,1,2]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..100]]; // Vincenzo Librandi, Feb 04 2015
    
  • Maple
    a:= n-> iquo(n+2, 2): seq(a(n), n=0..75);
  • Mathematica
    Flatten[Table[{n,n},{n,35}]] (* Harvey P. Dale, Sep 20 2011 *)
    With[{c=Range[40]},Riffle[c,c]] (* Harvey P. Dale, Feb 23 2013 *)
    CoefficientList[Series[1/(1 - x - x^2 + x^3), {x, 0, 75}], x] (* Robert G. Wilson v, Feb 05 2015 *)
    LinearRecurrence[{1, 1, -1}, {1, 1, 2}, 75] (* Robert G. Wilson v, Feb 05 2015 *)
    Table[QBinomial[n, 2, -1], {n, 2, 75}] (* John Keith, Jun 28 2021 *)
  • PARI
    a(n)=n\2+1
    
  • Python
    def A008619(n): return (n>>1)+1 # Chai Wah Wu, Jul 07 2022
  • Sage
    a = lambda n: 1 if n==0 else a(n-1)+1 if 2.divides(n) else a(n-1) # Peter Luschny, Feb 05 2015
    
  • Scala
    (2 to 99).map( / 2) // _Alonso del Arte, May 09 2020
    

Formula

Euler transform of [1, 1].
a(n) = 1 + floor(n/2).
G.f.: 1/((1-x)(1-x^2)).
E.g.f.: ((3+2*x)*exp(x) + exp(-x))/4.
a(n) = a(n-1) + a(n-2) - a(n-3) = -a(-3-n).
a(0) = a(1) = 1 and a(n) = floor( (a(n-1) + a(n-2))/2 + 1 ).
a(n) = (2*n + 3 + (-1)^n)/4. - Paul Barry, May 27 2003
a(n) = Sum_{k=0..n} Sum_{j=0..k} Sum_{i=0..j} binomial(j, i)*(-2)^i. - Paul Barry, Aug 26 2003
E.g.f.: ((1+x)*exp(x) + cosh(x))/2. - Paul Barry, Sep 13 2003
a(n) = A108299(n-1,n)*(-1)^floor(n/2) for n > 0. - Reinhard Zumkeller, Jun 01 2005
a(n) = A108561(n+2,n) for n > 0. - Reinhard Zumkeller, Jun 10 2005
a(n) = A125291(A125293(n)) for n>0. - Reinhard Zumkeller, Nov 26 2006
a(n) = ceiling(n/2), n >= 1. - Mohammad K. Azarian, May 22 2007
INVERT transformation yields A006054 without leading zeros. INVERTi transformation yields negative of A124745 with the first 5 terms there dropped. - R. J. Mathar, Sep 11 2008
a(n) = A026820(n,2) for n > 1. - Reinhard Zumkeller, Jan 21 2010
a(n) = n - a(n-1) + 1 (with a(0)=1). - Vincenzo Librandi, Nov 19 2010
a(n) = A000217(n) / A110654(n). - Reinhard Zumkeller, Aug 24 2011
a(n+1) = A181971(n,n). - Reinhard Zumkeller, Jul 09 2012
1/(1+2/(2+3/(3+4/(4+5/(5+...(continued fraction))))) = 1/(e-1), see A073333. - Philippe Deléham, Mar 09 2013
a(n) = floor(A000217(n)/n), n > 0. - L. Edson Jeffery, Jul 26 2013
a(n) = n*a(n-1) mod (n+1) = -a(n-1) mod (n+1), the least positive residue modulo n+1 for each expression for n > 0, with a(0) = 1 (basically restatements of Vincenzo Librandi's formula). - Rick L. Shepherd, Apr 02 2014
a(n) = (a(0) + a(1) + ... + a(n-1))/a(n-1), where a(0) = 1. - Melvin Peralta, Jun 16 2015
a(n) = Sum_{k=0..n} (-1)^(n-k) * (k+1). - Rick L. Shepherd, Sep 18 2020
a(n) = a(n-2) + 1 for n >= 2. - Vladimír Modrák, Sep 29 2020
a(n) = A004526(n)+1. - Chai Wah Wu, Jul 07 2022

Extensions

Additional remarks from Daniele Parisse
Edited by N. J. A. Sloane, Sep 06 2009
Partially edited by Joerg Arndt, Mar 11 2010

A034851 Rows of Losanitsch's triangle T(n, k), n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 3, 6, 6, 3, 1, 1, 3, 9, 10, 9, 3, 1, 1, 4, 12, 19, 19, 12, 4, 1, 1, 4, 16, 28, 38, 28, 16, 4, 1, 1, 5, 20, 44, 66, 66, 44, 20, 5, 1, 1, 5, 25, 60, 110, 126, 110, 60, 25, 5, 1, 1, 6, 30, 85, 170, 236, 236, 170, 85, 30, 6, 1, 1, 6, 36, 110, 255
Offset: 0

Views

Author

Keywords

Comments

Sometimes erroneously called "Lossnitsch's triangle". But the author's name is Losanitsch (I have seen the original paper in Chem. Ber.). This is a German version of the Serbian name Lozanic. - N. J. A. Sloane, Jun 29 2008
For n >= 3, a(n-3,k) is the number of series-reduced (or homeomorphically irreducible) trees which become a path P(k+1) on k+1 nodes, k >= 0, when all leaves are omitted (see illustration). Proof by Pólya's enumeration theorem. - Wolfdieter Lang, Jun 08 2001
The number of ways to put beads of two colors in a line, but take symmetry into consideration, so that 011 and 110 are considered the same. - Yong Kong (ykong(AT)nus.edu.sg), Jan 04 2005
Alternating row sums are 1,0,1,0,2,0,4,0,8,0,16,0,... - Gerald McGarvey, Oct 20 2008
The triangle sums, see A180662 for their definitions, link Losanitsch's triangle A034851 with several sequences, see the crossrefs. We observe that the Ze3 and Ze4 sums link Losanitsch's triangle with A005683, i.e., R. K. Guy's Twopins game. - Johannes W. Meijer, Jul 14 2011
T(n-(L-1)k, k) is the number of ways to cover an n-length line by exactly k L-length segments excluding symmetric covers. For L=2 it is corresponds to A102541, for L=3 to A228570 and for L=4 to A228572. - Philipp O. Tsvetkov, Nov 08 2013
Also the number of equivalence classes of ways of placing k 1 X 1 tiles in an n X 1 rectangle under all symmetry operations of the rectangle. - Christopher Hunt Gribble, Feb 16 2014
T(n, k) is the number of non-isomorphic outer planar graphs of order n+3, size n+3+k, and maximum degree k+2. - Christian Barrientos, Oct 18 2018
From Álvar Ibeas, Jun 01 2020: (Start)
T(n, k) is the sum of even-degree coefficients of the Gaussian polynomial [n, k]_q. The area below a NE lattice path between (0,0) and (k, n-k) is even for T(n, k) paths and odd for A034852(n, k) of them.
For a (non-reversible) string of k black and n-k white beads, consider the minimum number of bead transpositions needed to place the black ones to the left and the white ones to the right (in other words, the number of inversions of the permutation obtained by labeling the black beads by integers 1,...,k and the white ones by k+1,...,n, in the same order they take on the string). It is even for T(n, k) strings and odd for A034852(n, k) cases.
(End)
Named after the Serbian chemist, politician and diplomat Simeon Milivoje "Sima" Lozanić (1847-1935). - Amiram Eldar, Jun 10 2021
T(n, k) is the number of caterpillars with a perfect matching, with 2n+2 vertices and diameter 2n-1-k. - Christian Barrientos, Sep 12 2023

Examples

			Triangle begins
  1;
  1,  1;
  1,  1,  1;
  1,  2,  2,  1;
  1,  2,  4,  2,  1;
  1,  3,  6,  6,  3,  1;
  1,  3,  9, 10,  9,  3,  1;
  1,  4, 12, 19, 19, 12,  4,  1;
  1,  4, 16, 28, 38, 28, 16,  4,  1;
  1,  5, 20, 44, 66, 66, 44, 20,  5,  1;
		

Crossrefs

Triangle sums (see the comments): A005418 (Row), A011782 (Related to Row2), A102526 (Related to Kn11, Kn12, Kn13, Kn21, Kn22, Kn23), A005207 (Kn3, Kn4), A005418 (Fi1, Fi2), A102543 (Ca1, Ca2), A192928 (Gi1, Gi2), A005683 (Ze3, Ze4).
Sums of squares of terms in rows equal A211208.

Programs

  • Haskell
    a034851 n k = a034851_row n !! k
    a034851_row 0 = [1]
    a034851_row 1 = [1,1]
    a034851_row n = zipWith (-) (zipWith (+) ([0] ++ losa) (losa ++ [0]))
                                ([0] ++ a204293_row (n-2) ++ [0])
       where losa = a034851_row (n-1)
    a034851_tabl = map a034851_row [0..]
    -- Reinhard Zumkeller, Jan 14 2012
  • Maple
    A034851 := proc(n,k) option remember; local t; if k = 0 or k = n then return(1) fi; if n mod 2 = 0 and k mod 2 = 1 then t := binomial(n/2-1,(k-1)/2) else t := 0; fi; A034851(n-1,k-1)+A034851(n-1,k)-t; end: seq(seq(A034851(n, k), k=0..n), n=0..11);
  • Mathematica
    t[n_?EvenQ, k_?OddQ] := Binomial[n, k]/2; t[n_, k_] := (Binomial[n, k] + Binomial[Quotient[n, 2], Quotient[k, 2]])/2; Flatten[Table[t[n, k], {n, 0, 12}, {k, 0, n}]](* Jean-François Alcover, Feb 07 2012, after PARI *)
  • PARI
    {T(n, k) = (1/2) *(binomial(n, k) + binomial(n%2, k%2) * binomial(n\2, k\2))}; /* Michael Somos, Oct 20 1999 */
    

Formula

T(n, k) = (1/2) * (A007318(n, k) + A051159(n, k)).
G.f. for k-th column (if formatted as lower triangular matrix a(n, k)): x^k*Pe(floor((k+1)/2), x^2)/(((1-x)^(k+1))*(1+x)^(floor((k+1)/2))), where Pe(n, x^2) := Sum_{m=0..floor(n/2)} A034839(n, m)*x^(2*m) (row polynomials of Pascal array even numbered columns). - Wolfdieter Lang, May 08 2001
a(n, k) = a(n-1, k-1) + a(n-1, k) - C(n/2-1, (k-1)/2), where the last term is present only if n is even and k is odd (see Sloane link).
T(n, k) = T(n-2, k-2) + T(n-2, k) + C(n-2, k-1), n > 1.
Let P(n, x, y) = Sum_{m=0..n} a(n, m)*x^m*y^(n-m), then for x > 0, y > 0 we have P(n, x, y) = (x+y)*P(n-1, x, y) for n odd and P(n, x, y) = (x+y)*P(n-1, x, y) - x*y*(x^2+y^2)^((n-2)/2) for n even. - Gerald McGarvey, Feb 15 2005
T(n, k) = T(n-1, k-1) + T(n-1, k) - A204293(n-2, k-1), 0 < k <= n and n > 1. - Reinhard Zumkeller, Jan 14 2012
From Christopher Hunt Gribble, Feb 25 2014: (Start)
It appears that:
T(n,k) = C(n,k)/2, n even, k odd;
T(n,k) = (C(n,k) + C(n/2,k/2))/2, n even, k even;
T(n,k) = (C(n,k) + C((n-1)/2,(k-1)/2))/2, n odd, k odd;
T(n,k) = (C(n,k) + C((n-1)/2,k/2))/2, n odd, k even.
(End)

Extensions

More terms from James Sellers, May 04 2000
Name edited by Johannes W. Meijer, Aug 26 2013

A357136 Triangle read by rows where T(n,k) is the number of integer compositions of n with alternating sum k = 0..n. Part of the full triangle A097805.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 3, 0, 3, 0, 1, 0, 6, 0, 4, 0, 1, 10, 0, 10, 0, 5, 0, 1, 0, 20, 0, 15, 0, 6, 0, 1, 35, 0, 35, 0, 21, 0, 7, 0, 1, 0, 70, 0, 56, 0, 28, 0, 8, 0, 1, 126, 0, 126, 0, 84, 0, 36, 0, 9, 0, 1, 0, 252, 0, 210, 0, 120, 0, 45, 0, 10, 0, 1
Offset: 0

Views

Author

Gus Wiseman, Sep 30 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			Triangle begins:
    1
    0   1
    1   0   1
    0   2   0   1
    3   0   3   0   1
    0   6   0   4   0   1
   10   0  10   0   5   0   1
    0  20   0  15   0   6   0   1
   35   0  35   0  21   0   7   0   1
    0  70   0  56   0  28   0   8   0   1
  126   0 126   0  84   0  36   0   9   0   1
    0 252   0 210   0 120   0  45   0  10   0   1
  462   0 462   0 330   0 165   0  55   0  11   0   1
    0 924   0 792   0 495   0 220   0  66   0  12   0   1
For example, row n = 5 counts the following compositions:
  .  (32)     .  (41)   .  (5)
     (122)       (113)
     (221)       (212)
     (1121)      (311)
     (2111)
     (11111)
		

Crossrefs

The full triangle counting compositions by alternating sum is A097805.
The version for partitions is A103919, full triangle A344651.
This is the right-half of even-indexed rows of A260492.
The triangle without top row and left column is A108044.
Ranking and counting compositions:
- product = sum: A335404, counted by A335405.
- sum = twice alternating sum: A348614, counted by A262977.
- length = alternating sum: A357184, counted by A357182.
- length = absolute value of alternating sum: A357185, counted by A357183.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.

Programs

  • Mathematica
    Prepend[Table[If[EvenQ[nn],Prepend[#,0],#]&[Riffle[Table[Binomial[nn,k],{k,Floor[nn/2],nn}],0]],{nn,0,10}],{1}]

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

A055870 Signed Fibonomial triangle.

Original entry on oeis.org

1, 1, -1, 1, -1, -1, 1, -2, -2, 1, 1, -3, -6, 3, 1, 1, -5, -15, 15, 5, -1, 1, -8, -40, 60, 40, -8, -1, 1, -13, -104, 260, 260, -104, -13, 1, 1, -21, -273, 1092, 1820, -1092, -273, 21, 1, 1, -34, -714, 4641, 12376, -12376, -4641, 714, 34, -1, 1, -55, -1870, 19635, 85085, -136136, -85085, 19635, 1870, -55, -1
Offset: 0

Views

Author

Wolfdieter Lang, Jul 10 2000

Keywords

Comments

Row n+1 (n >= 1) of the signed triangle lists the coefficients of the recursion relation for the n-th power of Fibonacci numbers A000045: Sum_{m=0..n+1} T(n+1,m)*(Fibonacci(k-m))^n = 0, k >= n+1; inputs: (Fibonacci(k))^n, k=0..n.
The inverse of the row polynomial p(n,x) := Sum_{m=0..n} T(n,m)*x^m is the g.f. for the column m=n-1 of the Fibonomial triangle A010048.
The row polynomials p(n,x) factorize according to p(n,x) = G(n-1)*p(n-2,-x), with inputs p(0,x)= 1, p(1,x)= 1-x and G(n):= 1 - A000032(n)*x + (-1)^n*x^2. (Derived from Riordan's result and Knuth's exercise).
The row polynomials are the characteristic polynomials of product of the binomial matrix binomial(i,j) and the exchange matrix J_n (matrix with 1's on the antidiagonal, 0 elsewhere). - Paul Barry, Oct 05 2004

Examples

			Row polynomial for n=4: p(4,x) = 1-3*x-6*x^2+3*x^3+x^4 = (1+x-x^2)*(1-4*x-x^2). 1/p(4,x) is G.f. for A010048(n+3,3), n >= 0: {1,3,15,60,...} = A001655(n).
For n=3: 1*(Fibonacci(k))^3 - 3*(Fibonacci(k-1))^3 - 6*(Fibonacci(k-2))^3 + 3*(Fibonacci(k-3))^3 + 1*(Fibonacci(k-4))^3 = 0, k >= 4; inputs: (Fibonacci(k))^3, k=0..3.
The triangle begins:
  n\m 0   1     2    3     4      5     6    7   8   9
  0   1
  1   1  -1
  2   1  -1    -1
  3   1  -2    -2    1
  4   1  -3    -6    3     1
  5   1  -5   -15   15     5     -1
  6   1  -8   -40   60    40     -8    -1
  7   1 -13  -104  260   260   -104   -13    1
  8   1 -21  -273 1092  1820  -1092  -273   21   1
  9   1 -34  -714 4641 12376 -12376 -4641  714  34  -1
  ... [_Wolfdieter Lang_, Aug 06 2012; a(7,1) corrected, Oct 10 2012]
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 1, pp. 84-5 and 492.

Crossrefs

Sums include: A055871 (signed row), A056569 (row).
Central column: A003268.
Cf. A383715.

Programs

  • Magma
    Fibonomial:= func< n,k | k eq 0 select 1 else (&*[Fibonacci(n-j+1)/Fibonacci(j): j in [1..k]]) >;
    [(-1)^Floor((k+1)/2)*Fibonomial(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 20 2024
    
  • Maple
    A055870 := proc(n,k)
        (-1)^floor((k+1)/2)*A010048(n,k) ;
    end proc: # R. J. Mathar, Jun 14 2015
  • Mathematica
    T[n_, m_]:= {1,-1,-1,1}[[Mod[m,4] + 1]] * Product[ Fibonacci[n-j+1]/Fibonacci[j], {j, m}];
    Table[T[n, m], {n, 0, 10}, {m, 0, n}]//Flatten (* Jean-François Alcover, Jul 05 2013 *)
  • SageMath
    def fibonomial(n,k): return 1 if k==0 else product(fibonacci(n-j+1)/fibonacci(j) for j in range(1,k+1))
    flatten([[(-1)^((k+1)//2)*fibonomial(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jul 20 2024

Formula

T(n, m) = (-1)^floor((m+1)/2)*A010048(n, m), where A010048(n, m) := fibonomial(n, m).
G.f. for column m: (-1)^floor((m+1)/2)*x^m/p(m+1, x) with the row polynomial of the (signed) triangle: p(n, x) := Sum_{m=0..n} T(n, m)*x^m.
Sum_{k=0..n} T(n,k) * x^k = exp( -Sum_{k>=1} Fibonacci(n*k)/Fibonacci(k) * x^k/k ). - Seiichi Manyama, May 07 2025

A357189 Number of integer partitions of n with the same length as alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 1, 1, 1, 2, 2, 4, 3, 5, 6, 9, 9, 13, 16, 23, 23, 34, 37, 54, 54, 78, 84, 120, 121, 170, 182, 252, 260, 358, 379, 517, 535, 725, 764, 1030, 1064, 1427, 1494, 1992, 2059, 2733, 2848, 3759, 3887, 5106, 5311, 6946, 7177, 9345, 9701, 12577, 12996, 16788
Offset: 0

Views

Author

Gus Wiseman, Sep 30 2022

Keywords

Comments

A partition of n is a weakly decreasing sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(4) = 1 through a(13) = 9 partitions:
  31   311   42   322   53     333     64     443     75       553
                  421   5111   432     5221   542     5331     652
                               531     6211   641     6222     751
                               51111          52211   6321     52222
                                              62111   7311     53311
                                                      711111   62221
                                                               63211
                                                               73111
                                                               7111111
		

Crossrefs

For product equal to sum we have A001055, compositions A335405.
For product instead of length we have A004526, compositions A114220.
The version for compositions is A357182, ranked by A357184.
For sum equal to twice alternating sum we have A357189 (this sequence).
These partitions are ranked by A357486.
The reverse version is A357487, ranked by A357485.
A000041 counts partitions, strict A000009.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],Length[#]==ats[#]&]],{n,0,30}]

A357488 Number of integer partitions of 2n - 1 with the same length as alternating sum.

Original entry on oeis.org

1, 0, 1, 2, 4, 5, 9, 13, 23, 34, 54, 78, 120, 170, 252, 358, 517, 725, 1030, 1427, 1992, 2733, 3759, 5106, 6946, 9345, 12577, 16788, 22384, 29641, 39199, 51529, 67626, 88307, 115083, 149332, 193383, 249456, 321134, 411998, 527472, 673233, 857539, 1089223, 1380772
Offset: 1

Views

Author

Gus Wiseman, Oct 02 2022

Keywords

Comments

A partition of n is a weakly decreasing sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(7) = 9 partitions:
  (1)  .  (311)  (322)  (333)    (443)    (553)
                 (421)  (432)    (542)    (652)
                        (531)    (641)    (751)
                        (51111)  (52211)  (52222)
                                 (62111)  (53311)
                                          (62221)
                                          (63211)
                                          (73111)
                                          (7111111)
		

Crossrefs

For product equal to sum we have A001055, compositions A335405.
The version for compositions appears to be A222763, odd version of A357182.
These are the odd-indexed terms of A357189, ranked by A357486.
These partitions are ranked by the odd-sum portion of A357485.
Except at the start, alternately adding zeros gives A357487.
A000041 counts partitions, strict A000009.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],Length[#]==ats[#]&]],{n,1,30,2}]

Formula

a(n) = A357189(2n - 1).

Extensions

More terms from Alois P. Heinz, Oct 04 2022

A026374 Triangular array T read by rows: T(n,0) = T(n,n) = 1 for all n >= 0, T(n,k) = T(n-1,k-1) + T(n-1,k) for odd n and 1< = k <= n-1, T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-2,k-1) for even n and 1 <= k <= n-1.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 4, 4, 1, 1, 6, 11, 6, 1, 1, 7, 17, 17, 7, 1, 1, 9, 30, 45, 30, 9, 1, 1, 10, 39, 75, 75, 39, 10, 1, 1, 12, 58, 144, 195, 144, 58, 12, 1, 1, 13, 70, 202, 339, 339, 202, 70, 13, 1, 1, 15, 95, 330, 685, 873, 685, 330, 95, 15, 1
Offset: 0

Views

Author

Keywords

Comments

T(n,k) is number of lattice paths from (0,0) to (n,n-2k) using steps U=(1,1), D=(1,-1) and, at levels ...,-4,-2,0,2,4,..., also H=(2,0). Example: T(4,1)=6 because we have the following paths from (0,0) to (4,2): UUUD, UUH, UUDU, UDUU, HUU and DUUU. Row sums yield A026383. Column 1 is A032766, column 2 is A026381, column 3 is A026382. - Emeric Deutsch, Jan 25 2004

Examples

			Triangle starts:
  1;
  1,  1;
  1,  3,   1;
  1,  4,   4,   1;
  1,  6,  11,   6,    1;
  1,  7,  17,  17,    7,    1;
  1,  9,  30,  45,   30,    9,    1;
  1, 10,  39,  75,   75,   39,   10,    1;
  1, 12,  58, 144,  195,  144,   58,   12,   1;
  1, 13,  70, 202,  339,  339,  202,   70,  13,   1;
  1, 15,  95, 330,  685,  873,  685,  330,  95,  15,  1;
  1, 16, 110, 425, 1015, 1558, 1558, 1015, 425, 110, 16, 1;
		

Crossrefs

Cf. A026375 (central terms).

Programs

  • Haskell
    a026374 n k = a026374_tabl !! n !! k
    a026374_row n = a026374_tabl !! n
    a026374_tabl = [1] : map fst (map snd $ iterate f (1, ([1, 1], [1]))) where
       f (0, (us, vs)) = (1, (zipWith (+) ([0] ++ us) (us ++ [0]), us))
       f (1, (us, vs)) = (0, (zipWith (+) ([0] ++ vs ++ [0]) $
                                 zipWith (+) ([0] ++ us) (us ++ [0]), us))
    -- Reinhard Zumkeller, Feb 22 2014
  • Mathematica
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a] (* Roger L. Bagula and Gary W. Adamson, Dec 04 2009 *)

Formula

T(n, k) = number of integer strings s(0), ..., s(n) such that s(0)=0, s(n) = n-2k, where, for 1 <= i <= n, s(i) is even if i is even and |s(i) - s(i-1)| <= 1.
From Emeric Deutsch, Jan 25 2004: (Start)
T(2n, k) = Sum_{j=ceiling(k/2)..k} 3^(2j-k)*binomial(n, j)*binomial(j, k-j);
T(2n+1, k) = T(2n, k-1) + T(2n, k).
G.f.: (1 + z + t*z)/(1 - (1+3*t+t^2)*z^2) = 1 + (1+t)*z + (1+3*t+t^2)*z^2+ ... .
Generating polynomial for row 2n is (1 + 3*t + t^2)^n;
Generating polynomial for row 2n+1 it is (1+t)*(1 + 3*t + t^2)^n. (End)
From Emeric Deutsch, Jan 30 2004: (Start)
T(2n, k) = Sum_{j=ceiling(k/2)..k} 3^(2j-k)*binomial(n, j)*binomial(j, k-j);
T(2n+1, k) = T(2n, k-1) + T(2n, k). (End)

A119963 Triangle T(n,k), 0 <= k <= n, read by rows, with T(2n,2k) = T(2n+1,2k) = T(2n+1,2k+1) = T(2n+2,2k+1) = binomial(n,k).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 2, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 4, 3, 6, 3, 4, 1, 1, 1, 1, 4, 4, 6, 6, 4, 4, 1, 1, 1, 1, 5, 4, 10, 6, 10, 4, 5, 1, 1, 1, 1, 5, 5, 10, 10, 10, 10, 5, 5, 1, 1, 1, 1, 6, 5, 15, 10, 20, 10, 15, 5, 6, 1, 1, 1, 1, 6, 6, 15, 15, 20, 20, 15, 15, 6, 6, 1, 1, 1, 1, 7, 6, 21, 15, 35, 20, 35, 15, 21, 6, 7, 1, 1
Offset: 0

Views

Author

Philippe Deléham, Aug 02 2006

Keywords

Comments

From John P. McSorley, Aug 24 2010: (Start)
A combinatorial interpretation of this triangle is as follows:
Ignore the first column of 1's of the above triangle and the call the (n,k) entry of the new triangle formed RE(n,k).
Hence row 8 of the 'RE(n,k)' triangle is 1 4 3 6 3 4 1 1.
Now see sequence A180171 for the definition of a k-reverse of n.
Briefly, a k-reverse of n is a k-composition of n which is cyclically equivalent to its reverse.
Sequence A180171 is the 'R(n,k)' triangle read by rows where R(n,k) is the total number of k-reverses of n.
Then RE(n,k) is the number of k-reverses of n up to cyclic equivalence.
In sequence A180171 we have R(8,3)=9 because there are 9 3-reverses of 8.
In cyclically equivalent classes: {116,611,161} {224,422,242}, and {233,323,332}; since there are 3 such classes we have RE(8,3)=3.
Similarly, in A180171, we have R(8,6)=21 because all 21 6-compositions of 8 are 6-reverses of 8, but they come in 4 cyclically equivalent classes (with representatives 111113, 111122, 111212, and 112112) hence RE(8,6)=4.
There is another (equivalent) interpretation for RE(n,k) involving k-subsets of Z_n, the integers modulo n, and the multiplier -1. See the McSorley/Schoen paper below for more details.
In this case it is convenient to count k-subsets up to dihedral equivalence, rather than cyclic equivalence.
The counts are the same. The row sums of the 'RE(n,k)' triangle give sequence A052955.
(End)
From Petros Hadjicostas, Oct 12 2017: (Start)
When 1 <= k <= n, each cyclically equivalence class of k-reverses of n is a "Sommerville symmetrical cyclic composition," which was introduced by Sommerville (1909). On pp. 301-304 of his paper, he proves that the number of such (equivalence classes of) compositions of n with length k is exactly T(n,k) = RE(n,k).
The equivalence class of a Sommerville symmetrical cyclic composition contains at least one palindromic composition (type I) or a composition that becomes a palindromic composition if we remove the first part (type II). A composition with only one part is a palindromic composition of both types. Hadjicostas and Zhang (2017) have proved that each equivalence class of k-reverses of n contains exactly two compositions that are either of type I or type II (except in the case when k | n and all the parts are the same).
For example, consider the case with n=8 and k=3, where RE(8,3)=3. As pointed above by J. P. McSorley, in cyclically equivalent classes we have {116,611,161} {224,422,242}, and {233,323,332}. The first class contains one composition of type I (161) and one of type II (611); the second class contains one composition of type I (242) and one of type II (422); and the last class contains one composition of type I (323) and one of type II (233).
When n = 6 and k = 4, the class of 4-reverses {1221, 2211, 2112, 1122} contains two compositions of type I (1221 and 2112).
If A is a set of positive integers and 1 <= k <= n, let RE_A(n,k) be the total number of Sommerville symmetrical cyclic compositions of n with length k and parts only in A (= number of cyclically equivalence classes of k-reverses of n with parts only in A). Then the g.f. of RE_A(n,k) is Sum_{n,k >= 1} RE_A(n,k) * x^n * y^k = (-1/2) + (1 + y * f_A(x))^2/(2 * (1 - y^2 * f_A(x^2)), where f_A(x) = Sum_{m in A} x^m. (For this sequence, A = all positive integers.)
Sequence A292200 contains the total number of Sommerville symmetrical cyclic compositions of n that are Carlitz (compositions that have length one, or have length >= 1 and adjacent parts of the composition on a circle are distinct).
(End)

Examples

			Triangle begins (with rows for n >= 0 and columns for k >= 0) as follows:
  1;
  1, 1;
  1, 1, 1;
  1, 1, 1, 1;
  1, 1, 2, 1, 1;
  1, 1, 2, 2, 1, 1;
  1, 1, 3, 2, 3, 1, 1;
  1, 1, 3, 3, 3, 3, 1, 1;
  1, 1, 4, 3, 6, 3, 4, 1, 1;
  1, 1, 4, 4, 6, 6, 4, 4, 1, 1;
  ...
		

References

  • John P. McSorley, Counting k-compositions of n with palindromic and related structures, preprint, 2010. [From John P. McSorley, Aug 24 2010]

Crossrefs

The row sums of the T(n,k) triangle give sequence A029744 whose terms are 1 more than the terms of sequence A052955 (row sums of RE(n,k) triangle). See sequence A029744 where there is a reference to necklaces relevant to the combinatorial interpretation and the McSorley and McSorley/Schoen papers given here. - John P. McSorley, Aug 31 2010

Programs

  • Mathematica
    Table[Binomial[Floor[(n - Boole[OddQ@ k])/2], Floor[k/2]], {n, 0, 10}, {k, 0, n}] (* Michael De Vlieger, Oct 11 2017, after PARI by Andrew Howroyd *)
  • PARI
    T(n,k) = binomial((n-k%2)\2, k\2); \\ Andrew Howroyd, Oct 08 2017

Formula

G.f.: Sum_{n,k >= 1} RE(n,k)*x^n*y^k = (1+x*y-x^2)*x*y/((1-x)*(1-x^2-x^2*y^2)). - Petros Hadjicostas, Oct 12 2017
G.f.: Sum_{n,k >= 0} T(n,k)*x^n*y^k = (1+x*y)*(1+x)/(1-x^2-x^2*y^2) as above, but adding 1/(1-x) to include n,k = 0 terms. - Paul Sampson, Nov 22 2017
T(n, k) = binomial(floor(n/2) - (k mod 2) * (1 - (n mod 2)), floor(k/2)) for 0 <= k <= n. - Petros Hadjicostas, May 29 2019

Extensions

Corrected by Philippe Deléham, Aug 20 2010
Showing 1-10 of 31 results. Next