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

A001405 a(n) = binomial(n, floor(n/2)).

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 70, 126, 252, 462, 924, 1716, 3432, 6435, 12870, 24310, 48620, 92378, 184756, 352716, 705432, 1352078, 2704156, 5200300, 10400600, 20058300, 40116600, 77558760, 155117520, 300540195, 601080390, 1166803110
Offset: 0

Views

Author

Keywords

Comments

Sperner's theorem says that this is the maximal number of subsets of an n-set such that no one contains another.
When computed from index -1, [seq(binomial(n,floor(n/2)), n = -1..30)]; -> [1,1,1,2,3,6,10,20,35,70,126,...] and convolved with aerated Catalan numbers [seq(((n+1) mod 2)*binomial(n,n/2)/((n/2)+1), n = 0..30)]; -> [1,0,1,0,2,0,5,0,14,0,42,0,132,0,...] shifts left by one: [1,1,2,3,6,10,20,35,70,126,252,...] and if again convolved with aerated Catalan numbers, gives A037952 apart from the initial term. - Antti Karttunen, Jun 05 2001 [This is correct because the g.f.'s satisfy (1+x*g001405(x))*g126120(x) = g001405(x) and g001405(x)*g126120(x) = g037952(x)/x. - R. J. Mathar, Sep 23 2021]
Number of ordered trees with n+1 edges, having nonroot nodes of outdegree 0 or 2. - Emeric Deutsch, Aug 02 2002
Gives for n >= 1 the maximum absolute column sum norm of the inverse of the Vandermonde matrix (a_ij) i=0..n-1, j=0..n-1 with a_00=1 and a_ij=i^j for (i,j) != (0,0). - Torsten Muetze, Feb 06 2004
Image of Catalan numbers A000108 under the Riordan array (1/(1-2x),-x/(1-2x)) or A065109. - Paul Barry, Jan 27 2005
Number of left factors of Dyck paths, consisting of n steps. Example: a(4)=6 because we have UDUD, UDUU, UUDD, UUDU, UUUD and UUUU, where U=(1,1) and D=(1,-1). - Emeric Deutsch, Apr 23 2005
Number of dispersed Dyck paths of length n; they are defined as concatenations of Dyck paths and (1,0)-steps on the x-axis; equivalently, Motzkin paths with no (1,0)-steps at positive height. Example: a(4)=6 because we have HHHH, HHUD, HUDH, UDHH, UDUD, and UUDD, where U=(1,1), H=(1,0), and D=(1,-1). - Emeric Deutsch, Jun 04 2011
a(n) is odd iff n=2^k-1. - Jon Perry, May 05 2005
An inverse Chebyshev transform of binomial(1,n)=(1,1,0,0,0,...) where g(x)->(1/sqrt(1-4*x^2))*g(x*c(x^2)), with c(x) the g.f. of A000108. - Paul Barry, May 13 2005
In a random walk on the number line, starting at 0 and with 0 absorbing after the first step, number of ways of ending up at a positive integer after n steps. - Joshua Zucker, Jul 31 2005
Maximum number of sums of the form Sum_{i=1..n} e(i)*a(i) that are congruent to 0 mod q, where e_i=0 or 1 and gcd(a_i,q)=1, provided that q > ceiling(n/2). - Ralf Stephan, Apr 27 2003
Also the number of standard tableaux of height <= 2. - Mike Zabrocki, Mar 24 2007
Hankel transform of this sequence forms A000012 = [1,1,1,1,1,1,1,...]. - Philippe Deléham, Oct 24 2007
A001263 * [1, -2, 3, -4, 5, ...] = [1, -1, -2, 3, 6, -10, -20, 35, 70, -126, ...]. - Gary W. Adamson, Jan 02 2008
Equals right border of triangle A153585. - Gary W. Adamson, Dec 28 2008
Second binomial transform of A168491. - Philippe Deléham, Nov 27 2009
a(n) is also the number of distinct strings of length n, each of which is a prefix of a string of balanced parentheses; see example. - Lee A. Newberg, Apr 26 2010
Number of symmetric balanced strings of n pairs of parentheses; see example. - Joerg Arndt, Jul 25 2011
a(n) is the number of permutation patterns modulo 2. - Olivier Gérard, Feb 25 2011
For n >= 2, a(n-1) is the number of incongruent two-color bracelets of 2*n-1 beads, n of which are black (A007123), having a diameter of symmetry. - Vladimir Shevelev, May 03 2011
The number of permutations of n elements where p(k-2) < p(k) for all k. - Joerg Arndt, Jul 23 2011
Also size of the equivalence class of S_{n+1} containing the identity permutation under transformations of positionally adjacent elements of the form abc <--> cba where a < b < c, cf. A210668. - Tom Roby, May 15 2012
a(n) is the number of symmetric Dyck paths of length 2n. - Matt Watson, Sep 26 2012
a(n) is divisible by A000108(floor(n/2)) = abs(A129996(n-2)). - Paul Curtz, Oct 23 2012
a(n) is the number of permutations of length n avoiding both 213 and 231 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
Number of symmetric standard Young tableaux of shape (n,n). - Ran Pan, Apr 10 2015
From Luciano Ancora, May 09 2015: (Start)
Also "stepped path" in the array formed by partial sums of the all 1's sequence (or a Pascal's triangle displayed as a square). Example:
[1], [1], 1, 1, 1, 1, 1, ... A000012
1, [2], [3], 4, 5, 6, 7, ...
1, 3, [6], [10], 15, 21, 28, ...
1, 4, 10, [20], [35], 56, 84, ...
1, 5, 15, 35, [70], [126], 210, ...
Sequences in second formula are the mixed diagonals shown in this array. (End)
a(n) = A265848(n,n). - Reinhard Zumkeller, Dec 24 2015
The constant Sum_{n >= 0} a(n)/n! is 1 + A130820. - Peter Bala, Jul 02 2016
Number of meanders (walks starting at the origin and ending at any altitude >= 0 that may touch but never go below the x-axis) with n steps from {-1,1}. - David Nguyen, Dec 20 2016
a(n) is also the number of paths of n steps (either up or down by 1) that end at the maximal value achieved along the path. - Winston Luo, Jun 01 2017
Number of binary n-tuples such that the number of 1's in the even positions is the same as the number of 1's in the odd positions. - Juan A. Olmos, Dec 21 2017
Equivalently, a(n) is the number of subsets of {1,...,n} containing as many even numbers as odd numbers. - Gus Wiseman, Mar 17 2018
a(n) is the number of Dyck paths with semilength = n+1, returns to the x-axis = floor((n+3)/2) and up movements in odd positions = floor((n+3)/2). Example: a(4)=6, U=up movement in odd position, u=up movement in even position, d=down movement, -=return to x-axis: Uududd-Ud-Ud-, Ud-Uudd-Uudd-, Uudd-Uudd-Ud-, Ud-Ud-Uududd-, Uudd-Ud-Uudd-, Ud-Uududd-Ud-. - Roger Ford, Dec 29 2017
Let C_n(R, H) denote the transition matrix from the ribbon basis to the homogeneous basis of the graded component of the algebra of noncommutative symmetric functions of order n. Letting I(2^(n-1)) denote the identity matrix of order 2^(n-1), it has been conjectured that the dimension of the kernel of C_n(R, H) - I(2^(n-1)) is always equal to a(n-1). - John M. Campbell, Mar 30 2018
The number of U-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are U-equivalent iff the positions of pattern U are identical in these paths. - Sergey Kirgizov, Apr 08 2018
All binary self-dual codes of length 2n, for n > 0, must contain at least a(n) codewords of weight n. More to the point, there will always be at least one, perhaps unique, binary self-dual code of length 2n that will contain exactly a(n) codewords that have a hamming weight equal to half the length of the code (n). This code can be constructed by direct summing the unique binary self-dual code of length 2 (up to permutation equivalence) to itself n times. A permutation equivalent code can be constructed by augmenting two identity matrices of length n together. - Nathan J. Russell, Nov 25 2018
Closed under addition. - Torlach Rush, Apr 18 2019
The sequence starting (1, 2, 3, 6, ...) is the invert transform of A097331: (1, 1, 0, 1, 0, 2, 0, 5, 0, 14, 0, 42, ...). - Gary W. Adamson, Feb 22 2020
From Gary W. Adamson, Feb 24 2020: (Start)
The sequence is the culminating limit of an infinite set of sequences with convergents of 2*cos(Pi/N), N = (3, 5, 7, 9, ...).
The first few such sequences are:
N = 3: (1, 1, 1, 1, 1, 1, 1, 1, ...)
N = 5: (1, 1, 2, 3, 5, 8, 13, 21, ...) = A000045
N = 7: (1, 1, 2, 3, 6, 10, 19, 33, ...) = A028495, a(n)/a(n-1) tends to 1.801937...
N = 9 (1, 1, 2, 3, 6, 10, 20, 35, ...) = A061551, a(n)/a(n_1) tends to 1.879385...
...
In the limit one gets the current sequence with ratio 2. (End)
a(n) is also the number of monotone lattice paths from (0,0) to (floor(n/2),ceiling(n/2)). These are the number of Grand Dyck paths when n is even. - Nachum Dershowitz, Aug 12 2020
The maximum number of preimages that a permutation of length n+1 can have under the consecutive-132-avoiding stack-sorting map. - Colin Defant, Aug 28 2020
Counts faro permutations of length n. Faro permutations are permutations avoiding the three consecutive patterns 231, 321 and 312. They are obtained by a perfect faro shuffle of two nondecreasing words of lengths differing by at most one. - Sergey Kirgizov, Jan 12 2021
Per "Sperner's Theorem", the largest possible familes of finite sets none of which contain any other sets in the family. - Renzo Benedetti, May 26 2021
a(n-1) are the incomplete, primitive Dyck paths of n steps without a first return: paths of U and D steps starting at the origin, never touching the horizontal axis later on, and ending above the horizontal axis. n=1: {U}, n=2: {UU}, n=3: {UUU, UUD}, n=4: {UUUU, UUUD, UUDU}, n=5: {UUUUU, UUUUD, UUUDD, UUDUU, UUUDU, UUDUD}. For comparison: A037952 counts incomplete Dyck paths with n steps with any number of intermediate returns to the horizontal axis, ending above the horizontal axis. - R. J. Mathar, Sep 24 2021
a(n) is the number of noncrossing partitions of [n] whose nontrivial blocks are of type {a,b}, with a <= n/2, b > n/2. - Francesca Aicardi, May 29 2022
Maximal coefficient of (1+x)^n. - Vaclav Kotesovec, Dec 30 2022
Sums of lower-left-to-upper-right diagonals of the Catalan Triangle A001263. - Howard A. Landman, Sep 16 2024

Examples

			For n = 4, the a(4) = 6 distinct strings of length 4, each of which is a prefix of a string of balanced parentheses, are ((((, (((), (()(, ()((, ()(), and (()). - _Lee A. Newberg_, Apr 26 2010
There are a(5)=10 symmetric balanced strings of 5 pairs of parentheses:
[ 1] ((((()))))
[ 2] (((()())))
[ 3] ((()()()))
[ 4] ((())(()))
[ 5] (()()()())
[ 6] (()(())())
[ 7] (())()(())
[ 8] ()()()()()
[ 9] ()((()))()
[10] ()(()())() - _Joerg Arndt_, Jul 25 2011
G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 35*x^7 + 70*x^8 + ...
The a(4)=6 binary 4-tuples such that the number of 1's in the even positions is the same as the number of 1's in the odd positions are 0000, 1100, 1001, 0110, 0011, 1111. - _Juan A. Olmos_, Dec 21 2017
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.
  • M. Aigner and G. M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 1999; see p. 135.
  • K. Engel, Sperner Theory, Camb. Univ. Press, 1997; Theorem 1.1.1.
  • P. Frankl, Extremal sets systems, Chap. 24 of R. L. Graham et al., eds, Handbook of Combinatorics, North-Holland.
  • J. C. P. Miller, editor, Table of Binomial Coefficients. Royal Society Mathematical Tables, Vol. 3, Cambridge Univ. Press, 1954.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.16(b), p. 452.

Crossrefs

Row sums of Catalan triangle A053121 and of symmetric Dyck paths A088855.
Enumerates the structures encoded by A061854 and A061855.
First differences are in A037952.
Apparently a(n) = lim_{k->infinity} A094718(k, n).
Partial sums are in A036256. Column k=2 of A182172. Column k=1 of A335570.
Bisections: A000984 (even part), A001700 (odd part).
Cf. A097331.
Cf. A107373, A340567, A340568, A340569 (popularity of certain patterns in faro permutations).

Programs

  • GAP
    List([0..40],n->Binomial(n,Int(n/2))); # Muniru A Asiru, Apr 08 2018
    
  • Haskell
    a001405 n = a007318_row n !! (n `div` 2) -- Reinhard Zumkeller, Nov 09 2011
    
  • Magma
    [Binomial(n, Floor(n/2)): n in [0..40]]; // Vincenzo Librandi, Nov 16 2014
    
  • Maple
    A001405 := n->binomial(n, floor(n/2)): seq(A001405(n), n=0..33);
  • Mathematica
    Table[Binomial[n, Floor[n/2]], {n, 0, 40}] (* Stefan Steinerberger, Apr 08 2006 *)
    Table[DifferenceRoot[Function[{a,n},{-4 n a[n]-2 a[1+n]+(2+n) a[2+n] == 0,a[1] == 1,a[2] == 1}]][n], {n, 30}] (* Luciano Ancora, Jul 08 2015 *)
    Array[Binomial[#,Floor[#/2]]&,40,0] (* Harvey P. Dale, Mar 05 2018 *)
  • Maxima
    A001405(n):=binomial(n,floor(n/2))$
    makelist(A001405(n),n,0,30); /* Martin Ettl, Nov 01 2012 */
    
  • PARI
    a(n) = binomial(n, n\2);
    
  • PARI
    first(n) = x='x+O('x^n); Vec((-1+2*x+sqrt(1-4*x^2))/(2*x-4*x^2)) \\ Iain Fox, Dec 20 2017 (edited by Iain Fox, May 07 2018)
    
  • Python
    from math import comb
    def A001405(n): return comb(n,n//2) # Chai Wah Wu, Jun 07 2022

Formula

a(n) = max_{k=0..n} binomial(n, k).
a(2*n) = A000984(n), a(2*n+1) = A001700(n).
By symmetry, a(n) = binomial(n, ceiling(n/2)). - Labos Elemer, Mar 20 2003
P-recursive with recurrence: a(0) = 1, a(1) = 1, and for n >= 2, (n+1)*a(n) = 2*a(n-1) + 4*(n-1)*a(n-2). - Peter Bala, Feb 28 2011
G.f.: (1+x*c(x^2))/sqrt(1-4*x^2) = 1/(1 - x - x^2*c(x^2)); where c(x) = g.f. for Catalan numbers A000108.
G.f.: (-1 + 2*x + sqrt(1-4*x^2))/(2*x - 4*x^2). - Lee A. Newberg, Apr 26 2010
G.f.: 1/(1 - x - x^2/(1 - x^2/(1 - x^2/(1 - x^2/(1 - ... (continued fraction). - Paul Barry, Aug 12 2009
a(0) = 1; a(2*m+2) = 2*a(2*m+1); a(2*m+1) = Sum_{k = 0..2*m} (-1)^k*a(k)*a(2*m-k). - Len Smiley, Dec 09 2001
G.f.: (sqrt((1+2*x)/(1-2*x)) - 1)/(2*x). - Vladeta Jovovic, Apr 28 2003
The o.g.f. A(x) satisfies A(x) + x*A^2(x) = 1/(1-2*x). - Peter Bala, Feb 28 2011
E.g.f.: BesselI(0, 2*x) + BesselI(1, 2*x). - Vladeta Jovovic, Apr 28 2003
a(0) = 1; a(2*m+2) = 2*a(2*m+1); a(2*m+1) = 2*a(2*m) - c(m), where c(m)=A000108(m) are the Catalan numbers. - Christopher Hanusa (chanusa(AT)washington.edu), Nov 25 2003
a(n) = Sum_{k=0..n} (-1)^k*2^(n-k)*binomial(n, k)*A000108(k). - Paul Barry, Jan 27 2005
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)*binomial(1, n-2*k). - Paul Barry, May 13 2005
From Paul Barry, Nov 02 2004: (Start)
a(n) = Sum_{k=0..floor((n+1)/2)} (binomial(n+1, k)*(cos((n-2*k+1)*Pi/2) + sin((n-2*k+1)*Pi/2))).
a(n) = Sum_{k=0..n+1}, (binomial(n+1, (n-k+1)/2)*(1-(-1)^(n-k))*(cos(k*Pi/2) + sin(k*Pi))/2). (End)
a(n) = Sum_{k=floor(n/2)..n} (binomial(n,n-k) - binomial(n,n-k-1)). - Paul Barry, Sep 06 2007
Inverse binomial transform of A005773 starting (1, 2, 5, 13, 35, 96, ...) and double inverse binomial transform of A001700. Row sums of triangle A132815. - Gary W. Adamson, Aug 31 2007
a(n) = Sum_{k=0..n} A120730(n,k). - Philippe Deléham, Oct 16 2008
a(n) = Sum_{k = 0..floor(n/2)} (binomial(n,k) - binomial(n,k-1)). - Nishant Doshi (doshinikki2004(AT)gmail.com), Apr 06 2009
Sum_{n>=0} a(n)/10^(n+1) = 0.1123724... = (sqrt(3)-sqrt(2))/(2*sqrt(2)); Sum_{n>=0} a(n)/100^(n+1) = 0.0101020306102035... = (sqrt(51)-sqrt(49))/(2*sqrt(49)). - Mark Dols, Jul 15 2010
Conjectured: a(n) = 2^n*2F1(1/2,-n;2;2), useful for number of paths in 1-d for which the coordinate is never negative. - Benjamin Phillabaum, Feb 20 2011
a(2*m+1) = (2*m+1)*a(2*m)/(m+1), e.g., a(7) = (7/4)*a(6) = (7/4)*20 = 35. - Jon Perry, Jan 20 2011
From Peter Bala, Feb 28 2011: (Start)
Let F(x) be the logarithmic derivative of the o.g.f. A(x). Then 1+x*F(x) is the o.g.f. for A027306.
Let G(x) be the logarithmic derivative of 1+x*A(x). Then x*G(x) is the o.g.f. for A058622. (End)
Let M = an infinite tridiagonal matrix with 1's in the super and subdiagonals and [1,0,0,0,...] in the main diagonal; and V = the vector [1,0,0,0,...]. a(n) = M^n*V, leftmost term. - Gary W. Adamson, Jun 13 2011
Let M = an infinite tridiagonal matrix with 1's in the super and subdiagonals and [1,0,0,0,...] in the main diagonal. a(n) = M^n_{1,1}. - Corrected by Gary W. Adamson, Jan 30 2012
a(n) = A007318(n, floor(n/2)). - Reinhard Zumkeller, Nov 09 2011
a(n+1) = Sum_{k=0..n} a(n-k)*A097331(k) = a(n) + Sum_{k=0..(n-1)/2} A000108(k)*a(n-2*k-1). - Philippe Deléham, Nov 27 2011
a(n) = A214282(n) - A214283(n), for n > 0. - Reinhard Zumkeller, Jul 14 2012
a(n) = Sum_{k=0..n} A168511(n,k)*(-1)^(n-k). - Philippe Deléham, Mar 19 2013
a(n+2*p-2) = Sum_{k=0..floor(n/2)} A009766(n-k+p-1, k+p-1) + binomial(n+2*p-2, p-2), for p >= 1. - Johannes W. Meijer, Aug 02 2013
O.g.f.: (1-x*c(x^2))/(1-2*x), with the o.g.f. c(x) of Catalan numbers A000108. See the rewritten formula given by Lee A. Newberg above. This is the o.g.f. for the row sums the Riordan triangle A053121. - Wolfdieter Lang, Sep 22 2013
a(n) ~ 2^n / sqrt(Pi * n/2). - Charles R Greathouse IV, Oct 23 2015
a(n) = 2^n*hypergeom([1/2,-n], [2], 2). - Vladimir Reshetnikov, Nov 02 2015
a(2*k) = Sum_{i=0..k} binomial(k, i)*binomial(k, i), a(2*k+1) = Sum_{i=0..k} binomial(k+1, i)*binomial(k, i). - Juan A. Olmos, Dec 21 2017
a(0) = 1, a(n) = 2 * a(n-1) for even n, a(n) = (2*n/(n+1)) * a(n-1) for odd n. - James East, Sep 25 2019
a(n) = A037952(n) + A000108(n/2) where A(.)=0 for non-integer argument. - R. J. Mathar, Sep 23 2021
From Amiram Eldar, Mar 10 2022: (Start)
Sum_{n>=0} 1/a(n) = 2*Pi/(3*sqrt(3)) + 2.
Sum_{n>=0} (-1)^n/a(n) = 2/3 - 2*Pi/(9*sqrt(3)). (End)
For k>2, Sum_{n>=0} a(n)/k^n = (sqrt((k+2)/(k-2)) - 1)*k/2. - Vaclav Kotesovec, May 13 2022
From Peter Bala, Mar 24 2023: (Start)
a(n) = Sum_{k = 0..n+1} (-1)^(k+binomial(n+2,2)) * k/(n+1) * binomial(n+1,k)^2.
(n + 1)*(2*n - 1)*a(n) = (-1)^(n+1)*2*a(n-1) + 4*(n - 1)*(2*n + 1)*a(n-2) with a(0) = a(1) = 1. (End)
a(n) = Integral_{x=-2..2} x^n*W(x)*dx, n>=0, where W(x) = sqrt((2+x)/(2-x))/(2*Pi) is a positive function on x=(-2,2) and is singular at x = 2. Therefore a(n) is a positive definite sequence. - Karol A. Penson, May 12 2025

A038754 a(2n) = 3^n, a(2n+1) = 2*3^n.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049, 118098, 177147, 354294, 531441, 1062882, 1594323, 3188646, 4782969, 9565938, 14348907, 28697814, 43046721, 86093442, 129140163, 258280326, 387420489
Offset: 0

Views

Author

Henry Bottomley, May 03 2000

Keywords

Comments

In general, for the recurrence a(n) = a(n-1)*a(n-2)/a(n-3), all terms are integers iff a(0) divides a(2) and first three terms are positive integers, since a(2n+k) = a(k)*(a(2)/a(0))^n for all nonnegative integers n and k.
Equals eigensequence of triangle A070909; (1, 1, 2, 3, 6, 9, 18, ...) shifts to the left with multiplication by triangle A070909. - Gary W. Adamson, May 15 2010
The a(n) represent all paths of length (n+1), n >= 0, starting at the initial node on the path graph P_5, see the second Maple program. - Johannes W. Meijer, May 29 2010
a(n) is the difference between numbers of multiple of 3 evil (A001969) and odious (A000069) numbers in interval [0, 2^(n+1)). - Vladimir Shevelev, May 16 2012
A "half-geometric progression": to obtain a term (beginning with the third one) we multiply the before previous one by 3. - Vladimir Shevelev, May 21 2012
Pisano periods: 1, 2, 1, 4, 8, 2, 12, 4, 1, 8, 10, 4, 6, 12, 8, 8, 32, 2, 36, 8, ... . - R. J. Mathar, Aug 10 2012
Numbers k such that the k-th cyclotomic polynomial has a root mod 3. - Eric M. Schmidt, Jul 31 2013
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, Jun 05 2014
Also, the number of walks of length n on the graph 0--1--2--3--4 starting at vertex 1. - Sean A. Irvine, Jun 03 2025

Examples

			In the interval [0,2^5) we have 11 multiples of 3 numbers, from which 10 are evil and only one (21) is odious. Thus a(4) = 10 - 1 = 9. - _Vladimir Shevelev_, May 16 2012
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a038754 n = a038754_list !! n
    a038754_list = concat $ transpose [a000244_list, a008776_list]
    -- Reinhard Zumkeller, Oct 19 2015
    
  • Magma
    [n le 2 select n else 3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 18 2016
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=3*a[n-2]+2 od: seq(a[n]+1, n=0..34); # Zerinvary Lajos, Mar 20 2008
    with(GraphTheory): P:=5: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=35; for n from 1 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P) od: seq(a(n),n=1..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{0,3},{1,2},40] (* Harvey P. Dale, Jan 26 2014 *)
    CoefficientList[Series[(1+2x)/(1-3x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 18 2016 *)
    Module[{nn=20,c},c=3^Range[0,nn];Riffle[c,2c]] (* Harvey P. Dale, Aug 21 2021 *)
  • PARI
    a(n)=(1/6)*(5-(-1)^n)*3^floor(n/2)
    
  • PARI
    a(n)=3^(n>>1)<
    				
  • SageMath
    [2^(n%2)*3^((n-(n%2))/2) for n in range(61)] # G. C. Greubel, Oct 10 2022

Formula

a(n) = a(n-1)*a(n-2)/a(n-3) with a(0)=1, a(1)=2, a(2)=3.
a(2*n) = (3/2)*a(2*n-1) = 3^n, a(2*n+1) = 2*a(2*n) = 2*3^n.
From Benoit Cloitre, Apr 27 2003: (Start)
a(1)=1, a(n)= 2*a(n-1) if a(n-1) is odd, or a(n)= (3/2)*a(n-1) if a(n-1) is even.
a(n) = (1/6)*(5-(-1)^n)*3^floor(n/2).
a(2*n) = a(2*n-1) + a(2*n-2) + a(2*n-3).
a(2*n+1) = a(2*n) + a(2*n-1). (End)
G.f.: (1+2*x)/(1-3*x^2). - Paul Barry, Aug 25 2003
From Reinhard Zumkeller, Sep 11 2003: (Start)
a(n) = (1 + n mod 2) * 3^floor(n/2).
a(n) = A087503(n) - A087503(n-1). (End)
a(n) = sqrt(3)*(2+sqrt(3))*(sqrt(3))^n/6 - sqrt(3)*(2-sqrt(3))*(-sqrt(3))^n/6. - Paul Barry, Sep 16 2003
From Reinhard Zumkeller, May 26 2008: (Start)
a(n) = A140740(n+2,2).
a(n+1) = a(n) + a(n - n mod 2). (End)
If p(i) = Fibonacci(i-3) and if A is the Hessenberg matrix of order n defined by A(i,j) = p(j-i+1), (i<=j), A(i,j)=-1, (i=j+1), and A(i,j)=0 otherwise. Then, for n>=1, a(n-1) = (-1)^n det A. - Milan Janjic, May 08 2010
a(n) = A182751(n) for n >= 2. - Jaroslav Krizek, Nov 27 2010
a(n) = Sum_{i=0..2^(n+1), i==0 (mod 3)} (-1)^A000120(i). - Vladimir Shevelev, May 16 2012
a(0)=1, a(1)=2, for n>=3, a(n)=3*a(n-2). - Vladimir Shevelev, May 21 2012
Sum_(n>=0) 1/a(n) = 9/4. - Alexander R. Povolotsky, Aug 24 2012
a(n) = sqrt(3*a(n-1)^2 + (-3)^(n-1)). - Richard R. Forberg, Sep 04 2013
a(n) = 2^((1-(-1)^n)/2)*3^((2*n-1+(-1)^n)/4). - Luce ETIENNE, Aug 11 2014
From Reinhard Zumkeller, Oct 19 2015: (Start)
a(2*n) = A000244(n), a(2*n+1) = A008776(n).
For n > 0: a(n+1) = a(n) + if a(n) odd then min{a(n), a(n-1)} else max{a(n), a(n-1)}, see also A128588. (End)
E.g.f.: (7*cosh(sqrt(3)*x) + 4*sqrt(3)*sinh(sqrt(3)*x) - 4)/3. - Stefano Spezia, Feb 17 2022
Sum_{n>=0} (-1)^n/a(n) = 3/4. - Amiram Eldar, Dec 02 2022

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

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 9, 14, 28, 47, 89, 155, 286, 507, 924, 1652, 2993, 5373, 9707, 17460, 31501, 56714, 102256, 184183, 331981, 598091, 1077870, 1942071, 3499720, 6305992, 11363361, 20475625, 36896355, 66484244, 119801329, 215873462, 388991876, 700937471
Offset: 0

Views

Author

Keywords

Comments

a(n+1) = S(n) for n>=1, where S(n) is the number of 01-words of length n, having first letter 1, in which all runlengths of 1's are odd. Example: S(4) counts 1000, 1001, 1010, 1110. See A077865. - Clark Kimberling, Jun 26 2004
For n>=1, number of compositions of n into floor(j/2) kinds of j's (see g.f.). - Joerg Arndt, Jul 06 2011
Counts walks of length n between the first and second nodes of P_3, to which a loop has been added at the end. Let A be the adjacency matrix of the graph P_3 with a loop added at the end. A is a 'reverse Jordan matrix' [0,0,1; 0,1,1; 1,1,0]. a(n) is obtained by taking the (1,2) element of A^n. - Paul Barry, Jul 16 2004
Interleaves A094790 and A094789. - Paul Barry, Oct 30 2004
a(n) appears in the formula for the nonnegative powers of rho:= 2*cos(Pi/7), the ratio of the smaller diagonal in the heptagon to the side length s=2*sin(Pi/7), when expressed in the basis <1,rho,sigma>, with sigma:=rho^2-1, the ratio of the larger heptagon diagonal to the side length, as follows. rho^n = C(n)*1 + C(n+1)*rho + a(n)*sigma, n>=0, with C(n) = A052547(n-2). See the Steinbach reference, and a comment under A052547. - Wolfdieter Lang, Nov 25 2010
If with the above notations the power basis <1,rho,rho^2> of Q(rho) is used, nonnegative powers of rho are given by rho^n = -a(n-1)*1 + A052547(n-1)*rho + a(n)*rho^2. For negative powers see A006054. - Wolfdieter Lang, May 06 2011
-a(n-1) also appears in the formula for the nonpositive powers of sigma (see the above comment for the definition, and the Steinbach basis <1,rho,sigma>) as follows: sigma^(-n) = A(n)*1 -a(n+1)*rho -A(n-1)*sigma, with A(n) = A052547(n), A(-1):=0. - Wolfdieter Lang, Nov 25 2010

Examples

			G.f. = x^2 + x^3 + 3*x^4 + 4*x^5 + 9*x^6 + 14*x^7 + 28*x^8 + 47*x^9 + ...
Regarding the description "number of compositions of n into floor(j/2) kinds of j's," the a(6)=9 compositions of 6 are (2a, 2a, 2a), (3a, 3a), (2a, 4a), (2a, 4b), (4a, 2a), (4b, 2a), (6a), (6b), (6c). - _Bridget Tenner_, Feb 25 2022
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. Witula, E. Hetmaniok and D. Slota, Sums of the powers of any order roots taken from the roots of a given polynomial, Proceedings of the 15th International Conference on Fibonacci Numbers and Their Applications (2012).

Crossrefs

Programs

  • Haskell
    a006053 n = a006053_list !! n
    a006053_list = 0 : 0 : 1 : zipWith (+) (drop 2 a006053_list)
       (zipWith (-) (map (2 *) $ tail a006053_list) a006053_list)
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [ n eq 1 select 0 else n eq 2 select 0 else n eq 3 select 1 else Self(n-1) +2*Self(n-2) -Self(n-3): n in [1..40] ]; // Vincenzo Librandi, Aug 19 2011
    
  • Maple
    a[0]:=0: a[1]:=0: a[2]:=1: for n from 3 to 40 do a[n]:=a[n-1]+2*a[n-2]-a[n-3] od:seq(a[n], n=0..40); # Emeric Deutsch
    A006053:=z**2/(1-z-2*z**2+z**3); # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    LinearRecurrence[{1,2,-1}, {0,0,1}, 50]  (* Vladimir Joseph Stephan Orlovsky, May 25 2011 *)
  • PARI
    {a(n) = if( n<0, n = -1-n; polcoeff( -1 / (1 - 2*x - x^2 + x^3) + x * O(x^n), n), polcoeff( x^2 / (1 - x - 2*x^2 + x^3) + x * O(x^n), n))}; /* Michael Somos, Nov 30 2014 */
    
  • SageMath
    @CachedFunction
    def a(n): # a = A006053
        if (n<3): return (n//2)
        else: return a(n-1) + 2*a(n-2) - a(n-3)
    [a(n) for n in range(41)] # G. C. Greubel, Feb 12 2023

Formula

G.f.: x^2/(1 - x - 2*x^2 + x^3). - Emeric Deutsch, Dec 14 2004
a(n) = c^(n-2) - a(n-1)*(c-1) + (1/c)*a(n-2) for n > 3 where c = 2*cos(Pi/7). Example: a(7) = 14 = c^5 - 9*(c-1) + 4/c = 18.997607... - 7.21743962... + 2.219832528... - Gary W. Adamson, Jan 24 2010
G.f.: -1 + 1/(1 - Sum_{j>=1} floor(j/2)*x^j). - Joerg Arndt, Jul 06 2011
a(n+2) = A094790(n/2+1)*(1+(-1)^n)/2 + A094789((n+1)/2)*(1-(-1)^n)/2. - Paul Barry, Oct 30 2004
First differences of A028495. - Floor van Lamoen, Nov 02 2005
a(n) = A187065(2*n+1); a(n+1) = A187066(2*n+1) = A187067(2*n). - L. Edson Jeffery, Mar 16 2011
a(n) = 2^n*(c(1)^(n-1)*(c(1)+c(2)) + c(3)^(n-1)*(c(3)+c(6)) + c(5)^(n-1)*(c(5)+c(4)) )/7, with c(j):=cos(Pi*j/7). - Herbert Kociemba, Dec 18 2011
a(n+1)*(-1)^n*49^(1/3) = (c(1)/c(4))^(1/3)*(2*c(1))^n + (c(2)/c(1))^(1/3)*(2*c(2))^n + (c(4)/c(2))^(1/3)*(2c(4))^n = (c(2)/c(1))^(1/3)*(2*c(1))^(n+1) + (c(4)/c(2))^(1/3)*(c(2))^(n+1) + (c(1)/c(4))^(1/3)*(2*c(4))^(n+1), where c(j) := cos(2Pi*j/7); for the proof, see Witula et al.'s papers. - Roman Witula, Jul 21 2012
The previous formula connects the sequence a(n) with A214683, A215076, A215100, A120757. We may call a(n) the Ramanujan-type sequence number 2 for the argument 2*Pi/7. - Roman Witula, Aug 02 2012
a(n) = -A006054(1-n) for all n in Z. - Michael Somos, Nov 30 2014
G.f.: x^2 / (1 - x / (1 - 2*x / (1 + 5*x / (2 - x / (5 - 2*x))))). - Michael Somos, Jan 20 2017
a(n) ~ r*c^n, where r=0.241717... is one of the roots of 49*x^3-7*x+1, and c=2*cos(Pi/7) (as in Gary W. Adamson's formula). - Daniel Checa, Nov 04 2022
a(2n-1) = 2*a(n+1)*a(n) - a(n)^2 - a(n-1)^2. - Richard Peterson, May 25 2023

Extensions

More terms from Emeric Deutsch, Dec 14 2004
Typo in definition fixed by Reinhard Zumkeller, Oct 14 2011

A068911 Number of n-step walks (each step +-1 starting from 0) which are never more than 2 or less than -2.

Original entry on oeis.org

1, 2, 4, 6, 12, 18, 36, 54, 108, 162, 324, 486, 972, 1458, 2916, 4374, 8748, 13122, 26244, 39366, 78732, 118098, 236196, 354294, 708588, 1062882, 2125764, 3188646, 6377292, 9565938, 19131876, 28697814, 57395628, 86093442, 172186884, 258280326, 516560652
Offset: 0

Views

Author

Henry Bottomley, Mar 06 2002

Keywords

Comments

From Johannes W. Meijer, May 29 2010: (Start)
a(n) is the number of ways White can force checkmate in exactly (n+1) moves, n >= 0, ignoring the fifty-move and the triple repetition rules, in the following chess position: White Ka1, Ra8, Bc1, Nb8, pawns a6, a7, b2, c6, d2, f6, g5 and h6; Black Ke8, Nh8, pawns b3, c7, d3, f7, g6 and h7. (After Noam D. Elkies, see link; diagram 5).
Counts all paths of length n, n >= 0, starting at the third node on the path graph P_5, see the Maple program. (End)
From Alec Jones, Feb 25 2016: (Start)
The a(n) are the n-th terms in a "Fibonacci snake" drawn on a rectilinear grid. The n-th term is computed as the sum of the previous terms in cells adjacent to the n-th cell (diagonals included). (This sequence excludes the first term of the snake.)
For example:
1 ... 1 1 ... 1 4 1 4 6 ... 1 4 6 1 4 6 ... and so on.
1 ... 1 2 1 2 ... 1 2 1 2 12 ... 1 2 12 18 (End)
From Gus Wiseman, Oct 06 2023: (Start)
Also the number of subsets of {1..n} containing no two distinct elements summing to n. The a(0) = 1 through a(4) = 12 subsets are:
{} {} {} {} {}
{1} {1} {1} {1}
{2} {2} {2}
{1,2} {3} {3}
{1,3} {4}
{2,3} {1,2}
{1,4}
{2,3}
{2,4}
{3,4}
{1,2,4}
{2,3,4}
For n+1 instead of n we have A038754, complement A167762.
Including twins gives A117855, complement A366131.
The complement is counted by A365544.
For all subsets (not just pairs) we have A365377, complement A365376. (End)

Examples

			The a(3) = 6 walks: (0,-1,-2,-1), (0,-1,0,-1), (0,-1,0,1), (0,1,0,-1), (0,1,0,1), (0,1,2,1). - _Gus Wiseman_, Oct 10 2023
		

Crossrefs

Cf. A000007, A016116 (without initial term), A068912, A068913 for similar.
Equals A060647(n-1)+1.
First differences are A117855.

Programs

  • Magma
    [Floor((5-(-1)^n)*3^Floor(n/2)/3): n in [0..40]]; // Bruno Berselli, Feb 26 2016, after Charles R Greathouse IV
    
  • Maple
    with(GraphTheory): G:= PathGraph(5): A:=AdjacencyMatrix(G): nmax:=34; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[3,k], k=1..5) od: seq(a(n), n=0..nmax); # Johannes W. Meijer, May 29 2010
    # second Maple program:
    a:= proc(n) a(n):= `if`(n<2, n+1, (4-irem(n, 2))/2*a(n-1)) end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 03 2019
  • Mathematica
    Join[{1},Transpose[NestList[{Last[#],3First[#]}&,{2,4},40]][[1]]] (* Harvey P. Dale, Oct 24 2011 *)
    Table[Length[Select[Subsets[Range[n]],FreeQ[Total/@Subsets[#,{2}],n]&]],{n,0,15}] (* Gus Wiseman, Oct 06 2023 *)
  • PARI
    a(n)=[4,6][n%2+1]*3^(n\2)\3 \\ Charles R Greathouse IV, Feb 26 2016
    
  • Python
    def A068911(n): return 3**(n>>1)<<1 if n&1 else (3**(n-1>>1)<<2 if n else 1) # Chai Wah Wu, Aug 30 2024

Formula

a(n) = A068913(2, n) = 2*A038754(n-1) = 3*a(n-2) = a(n-1)*a(n-2)/a(n-3) starting with a(0)=1, a(1)=2, a(2)=4 and a(3)=6.
For n>0: a(2n) = 4*3^(n-1) = 2*a(2n-1); a(2n+1) = 2*3^n = 3*a(2n)/2 = 2*a(2n)-A000079(n-2).
From Paul Barry, Feb 17 2004: (Start)
G.f.: (1+x)^2/(1-3x^2).
a(n) = 2*3^((n+1)/2)*((1-(-1)^n)/6 + sqrt(3)*(1+(-1)^n)/9) - (1/3)*0^n.
The sequence 0, 1, 2, 4, ... has a(n) = 2*3^(n/2)*((1+(-1)^n)/6 + sqrt(3)*(1-(-1)^n)/9) - (2/3)*0^n + (1/3)*Sum_{k=0..n} binomial(n, k)*k*(-1)^k. (End)
a(n) = 2^((3 + (-1)^n)/2)*3^((2*n - 3 - (-1)^n)/4) - ((1 - (-1)^(2^n)))/6. - Luce ETIENNE, Aug 30 2014
For n > 2, indexing from 0, a(n) = a(n-1) + a(n-2) if n is odd, a(n-1) + a(n-2) + a(n-3) if n is even. - Alec Jones, Feb 25 2016
a(n) = 2*a(n-1) if n is even, a(n-1) + a(n-2) if n is odd. - Vincenzo Librandi, Feb 26 2016
E.g.f.: (4*cosh(sqrt(3)*x) + 2*sqrt(3)*sinh(sqrt(3)*x) - 1)/3. - Stefano Spezia, Feb 17 2022

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

Original entry on oeis.org

1, 0, 2, 1, 5, 5, 14, 19, 42, 66, 131, 221, 417, 728, 1341, 2380, 4334, 7753, 14041, 25213, 45542, 81927, 147798, 266110, 479779, 864201, 1557649, 2806272, 5057369, 9112264, 16420730, 29587889, 53317085, 96072133, 173118414, 311945595, 562110290, 1012883066
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Form the graph with matrix A=[0,1,1;1,0,0;1,0,1] (P_3 with a loop at an extremity). Then A052547 counts closed walks of length n at the degree 2 vertex. - Paul Barry, Oct 02 2004
The characteristic polynomial x^3 - x^2 - 2*x + 1 generates a 3 step recursion: a(0)=1,a(1)=0,a(2)=2, for n>2 a(n)=a(n-1)+2*a(n-2)-a(n-3) so we can also prepend the term 1,0 to a(n) and get the same sequence, i.e. start with a(0)=1,a(1)=0,a(2)=1. - Lambert Klasen (lambert.klasen(AT)gmx.net), Jan 30 2005
The length of the diagonals (including the side) of a regular 7-gon (heptagon) inscribed in a circle of radius r=1 are d_1=2*sin(Pi/7) (the side length), d_2=2*cos(Pi/7)*d_1, and d_3=2*sin(3*Pi/7). The two ratios are rho := R_2 = d_2/d_1 = 2*cos(Pi/7) approximately 1.801937736, and sigma:= R_3 = d_3/d_1 = S(2,rho) = rho^2-1, approximately 2.246979604. See A049310 for Chebyshev S-polynomials. See the Steinbach reference where the basis <1,rho,sigma> has been considered for an extension of the rational field Q, which is there called Q(rho). This rho is the largest zero of S(6,x). For nonnegative powers of rho one has rho^n = C(n)*1 + B(n)*rho + A(n)*sigma, with B(n)=a(n-1), a(-1):=0, a(-2):=1, A(n)=B(n+1)-B(n-1)= A006053(n), and C(n)=B(n-1)=a(n-2), n>=0. For negative powers see A106803 and -A006054. For nonnegative and negative powers of sigma see A006054, A106803 and a(n), -A006053, respectively.
a(n) appears also in the formula for the nonpositive powers of sigma (see the comment above for the definition and the Steinbach basis) as sigma^(-n) = a(n)*1 - A006053(n+1)*rho - a(n-1)*sigma, n>=0. Put a(-1):=0. 1/sigma=sigma-rho, the smallest positive zero of S(6,x) (see A049310 for Chebyshev S-polynomials). - Wolfdieter Lang, Dec 01 2010

Crossrefs

Cf. A096976; second differences of A028495 and first differences of A006053 (up to an offset).

Programs

  • GAP
    a:=[1,0,2];; for n in [4..40] do a[n]:=a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, May 08 2019
  • Magma
    I:=[1,0,2]; [n le 3 select I[n] else Self(n-1) + 2*Self(n-2) - Self(n-3): n in [1..40]]; // G. C. Greubel, May 08 2019
    
  • Maple
    spec := [S,{S=Sequence(Prod(Z,Union(Z,Prod(Z, Sequence(Z)))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..40);
  • Mathematica
    LinearRecurrence[{1, 2, -1}, {1, 0, 2}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 13 2012 *)
  • PARI
    {a(n) = if(n==0,1,if(n==1,0,if(n==2,2,a(n-1)+2*a(n-2)-a(n-3))))};
    for(i=0,40,print1(a(i),",")) \\ Lambert Klasen, Jan 30 2005
    
  • Sage
    ((1-x)/(1-x-2*x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 08 2019
    

Formula

a(n) = a(n-1) + 2*a(n-2) - a(n-3), with a(0)=1, a(1)=0, a(2)=2.
a(n) = Sum(-1/7*_alpha*(-3+_alpha)*_alpha^(-1-n), _alpha=RootOf(_Z^3-2*_Z^2-_Z+1)).
a(n) = 5*a(n-2) - 6*a(n-4) + a(n-6). - Floor van Lamoen, Nov 02 2005

Extensions

More terms from James Sellers, Jun 05 2000

A178381 Number of paths of length n starting at initial node of the path graph P_9.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 70, 125, 250, 450, 900, 1625, 3250, 5875, 11750, 21250, 42500, 76875, 153750, 278125, 556250, 1006250, 2012500, 3640625, 7281250, 13171875, 26343750, 47656250, 95312500, 172421875, 344843750
Offset: 0

Views

Author

Johannes W. Meijer, May 27 2010, May 29 2010

Keywords

Comments

Counts all paths of length n, n>=0, starting at initial node on the path graph P_9, see the Maple program.
The a(n) represent the number of possible chess games, ignoring the fifty-move and the triple repetition rules, after n moves by White in the following position: White Ka1, Nh1, pawns a2, b6, c2, d6, f2, g3 and g4; Black Ka8, Bc8, pawns a3, b7, c3, d7, f3 and g5.
The path graphs P_(2*p) have as limit(a(n+1)/a(n), n =infinity) = 2 resp. hypergeom([(p-1)/(2*p+1),(p+2)/(2*p+1)],[1/2],3/4) and the path graphs P_(2*p+1) have as limit(a(n+1)/a(n), n =infinity) = 1+cos(Pi/(p+1)), p>=1; see the crossrefs. - Johannes W. Meijer, Jul 01 2010

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 35*x^7 + 70*x^8 + ...
		

Crossrefs

This is row 9 of A094718.
a(2*n) = A147748(n) and a(2*n+1) = A081567(n).
a(4*n+2) = A109106(n) and a(4*n+3) = A179135(n).
Cf. A000007 (P_1), A000012 (P_2), A016116 (P_3), A000045 (P_4), A038754 (P_5), A028495 (P_6), A030436 (P_7), A061551 (P_8), this sequence (P_9), A336675 (P_10), A336678 (P_11), and A001405 (P_infinity).
Cf. A216212 (P_9 starting in the middle).

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4))); // G. C. Greubel, Sep 18 2018
  • Maple
    with(GraphTheory): P:=9: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=36; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P); od: seq(a(n),n=0..nmax);
    r := j -> (-1)^(j/10) - (-1)^(1-j/10):
    a := k -> add((2 + r(j))*r(j)^k, j in [1, 3, 5, 7, 9])/10:
    seq(simplify(a(n)), n=0..30); # Peter Luschny, Sep 18 2020
  • Mathematica
    CoefficientList[Series[(1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4), {x,0,50}], x] (* G. C. Greubel, Sep 18 2018 *)
  • PARI
    x='x+O('x^50); Vec((1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4)) \\ G. C. Greubel, Sep 18 2018
    

Formula

G.f.: (1+x-3*x^2-2*x^3+x^4)/(1-5*x^2+5*x^4).
a(n) = 5*a(n-2) - 5*a(n-4) for n>=5 with a(0)=1, a(1)=1, a(2)=2, a(3)=3 and a(4)=6.
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 + x / (1 - x / (1 - x / (1 + x / (1 + x)))))))). - Michael Somos, Feb 08 2015

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

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 34, 68, 116, 232, 396, 792, 1352, 2704, 4616, 9232, 15760, 31520, 53808, 107616, 183712, 367424, 627232, 1254464, 2141504, 4283008, 7311552, 14623104, 24963200, 49926400, 85229696, 170459392, 290992384, 581984768, 993510144, 1987020288, 3392055808
Offset: 0

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Also (starting 3, 6, ...) the number of zig-zag paths from top to bottom of a rectangle of width 7 whose color is not that of the top right corner.
From Johannes W. Meijer, May 29 2010: (Start)
The a(n) represent the number of possible chess games, ignoring the fifty-move and the triple repetition rules, after n moves by White in the following position: White Ka1, Nh1, pawns a2, b6, c2, d6, f2, g3 and h2; Black Ka8, Bc8, pawns a3, b7, c3, d7, f3, g4 and h3.
Counts all paths of length n, n>=0, starting at the initial node on the path graph P_7, see the Maple program. (End)
Range of row n of the circular Pascal array of order 8. - Shaun V. Ault, Jun 05 2014.
In general, a(n,m) = (2^n/(m+1))*Sum_{r=1..m} (1-(-1)^r)*cos(Pi*r/(m+1))^n*(1+cos(Pi*r/(m+1))) gives the number of paths of length n starting at the initial node on the path graph P_m. Here we have m=7. - Herbert Kociemba, Sep 17 2020

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 34*x^7 + 68*x^8 + ...
		

Crossrefs

Programs

  • Maple
    with(GraphTheory): P:=7: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=31; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P); od: seq(a(n),n=0..nmax); # Johannes W. Meijer, May 29 2010
    X := j -> (-1)^(j/8) - (-1)^(1-j/8):
    a := k -> add((2 + X(j))*X(j)^k, j in [1, 3, 5, 7])/8:
    seq(simplify(a(n)), n=0..30); # Peter Luschny, Sep 17 2020
  • Mathematica
    CoefficientList[Series[(1+x-2x^2-x^3)/(1-4x^2+2x^4),{x,0,40}],x] (* or *) LinearRecurrence[{0,4,0,-2},{1,1,2,3},41] (* Harvey P. Dale, May 11 2011 *)
    a[n_,m_]:=2^(n+1)/(m+1) Module[{x=(Pi r)/(m+1)},Sum[Cos[x]^n (1+Cos[x]),{r,1,m,2}]]
    Table[a[n,7],{n,0,40}]//Round (* Herbert Kociemba, Sep 17 2020 *)
  • PARI
    Vec((1+x-2*x^2-x^3)/(1-4*x^2+2*x^4)+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    {a(n) = if( n<0, 0, polsym( x^4 - 4*x^2 + 2, n + n%2)[n + n%2 + 1] / (4 * (n%2 + 1)))}; /* Michael Somos, Feb 08 2015 */

Formula

a(0)=a(1)=1, a(2)=2, a(3)=3, a(n)=4*a(n-2)-2*a(n-4). - Harvey P. Dale, May 11 2011
a(n) = (2+sqrt(2+sqrt(2)))/8*(sqrt(2+sqrt(2)))^n + (2-sqrt(2+sqrt(2)))/8*(-sqrt(2+sqrt(2)))^n + (2+sqrt(2-sqrt(2)))/8*(sqrt(2-sqrt(2)))^n + (2-sqrt(2-sqrt(2)))/8*(-sqrt(2-sqrt(2)))^n. - Sergei N. Gladkovskii, Aug 23 2012
a(n) = A030435(n)/2. a(2*n) = A006012(n). a(2*n + 1) = A007052(n). - Michael Somos, Mar 06 2003
a(n) = (2^n/8)*Sum_{r=1..7} (1-(-1)^r)cos(Pi*r/8)^n*(1+cos(Pi*r/8)). - Herbert Kociemba, Sep 17 2020
E.g.f.: (2*cosh(r*x) + 2*cosh(s*x) + r*sinh(r*x) + s*sinh(s*x))/4, where r = sqrt(2 - sqrt(2)) and s = sqrt(2 + sqrt(2)). - Stefano Spezia, Jun 14 2023

Extensions

Comment and link added and typo in cross-reference corrected by Joseph Myers, Dec 24 2008, May 30 2010

A094718 Array T read by antidiagonals: T(n,k) is the number of involutions avoiding 132 and 12...k.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 4, 1, 0, 1, 2, 3, 5, 4, 1, 0, 1, 2, 3, 6, 8, 8, 1, 0, 1, 2, 3, 6, 9, 13, 8, 1, 0, 1, 2, 3, 6, 10, 18, 21, 16, 1, 0, 1, 2, 3, 6, 10, 19, 27, 34, 16, 1, 0, 1, 2, 3, 6, 10, 20, 33, 54, 55, 32, 1, 0, 1, 2, 3, 6, 10, 20, 34, 61, 81, 89, 32, 1
Offset: 1

Views

Author

Ralf Stephan, May 23 2004

Keywords

Comments

Also, number of paths along a corridor with width k, starting from one side (from H. Bottomley's comment in A061551).
Rows converge to binomial(n,floor(n/2)) (A001405).
Note that the rows and columns start at 1, which for example obscures the fact that the first row refers to A000007 and not to A000004. A better choice is the indexing 0 <= k and 0 <= n. The Maple program below uses this indexing and builds only on the roots of -1. - Peter Luschny, Sep 17 2020

Examples

			Array begins
  0   0   0   0   0   0   0   0   0   0 ...
  1   1   1   1   1   1   1   1   1   1 ...
  1   2   2   4   4   8   8  16  16  32 ...
  1   2   3   5   8  13  21  34  55  89 ...
  1   2   3   6   9  18  27  54  81 162 ...
  1   2   3   6  10  19  33  61 108 197 ...
  1   2   3   6  10  20  34  68 116 232 ...
  1   2   3   6  10  20  35  69 124 241 ...
  1   2   3   6  10  20  35  70 125 250 ...
  1   2   3   6  10  20  35  70 126 251 ...
  ...
		

Crossrefs

Main diagonal is A014495, antidiagonal sums are in A094719.
Cf. A080934 (permutations).

Programs

  • Maple
    X := (j, n) -> (-1)^(j/(n+1)) - (-1)^((n-j+1)/(n+1)):
    R := n -> select(k -> type(k, odd), [$(1..n)]):
    T := (n, k) -> add((2 + X(j,n))*X(j,n)^k, j in R(n))/(n+1):
    seq(lprint([n], seq(simplify(T(n, k)), k=0..10)), n=0..9); # Peter Luschny, Sep 17 2020
  • Mathematica
    U = ChebyshevU;
    m = maxExponent = 14;
    row[1] = Array[0&, m];
    row[k_] := 1/(x U[k, 1/(2x)])*Sum[U[j, 1/(2x)], {j, 0, k-1}] + O[x]^m // CoefficientList[#, x]& // Rest;
    T = Table[row[n], {n, 1, m}];
    Table[T[[n-k+1, k]], {n, 1, m-1}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 17 2018 *)

Formula

G.f. for k-th row: 1/(x*U(k, 1/(2*x))) * Sum_{j=0..k-1} U(j, 1/(2*x)), with U(k, x) the Chebyshev polynomials of second kind. [Clarified by Jean-François Alcover, Nov 17 2018]
T(n, k) = (1/(n+1))*Sum_{j=1..n, j odd} (2 + [j, n]) * [j, n]^k where [j, n] := (-1)^(j/(n+1)) - (-1)^((n-j+1)/(n+1)). - Peter Luschny, Sep 17 2020

A094790 Number of (s(0), s(1), ..., s(2n)) such that 0 < s(i) < 7 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2*n, s(0) = 1, s(2n) = 3.

Original entry on oeis.org

1, 3, 9, 28, 89, 286, 924, 2993, 9707, 31501, 102256, 331981, 1077870, 3499720, 11363361, 36896355, 119801329, 388991876, 1263047761, 4101088878, 13316149700, 43237262993, 140390505643, 455845099957, 1480119728920
Offset: 1

Views

Author

Herbert Kociemba, Jun 11 2004

Keywords

Comments

In general a(n) = (2/m)*Sum_{r=1..m-1} sin(r*j*Pi/m)*sin(r*k*Pi/m)*(2*cos(r*Pi/m))^(2n)) counts (s(0), s(1), ..., s(2n)) such that 0 < s(i) < m and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = j, s(2n) = k.
With interpolated zeros (0,0,1,0,3,0,9,...), counts walks of length n between the first and third nodes of P_6. - Paul Barry, Jan 26 2005
Counts all paths of length (2*n+1), n >= 0, starting at the initial node and ending on the nodes 1, 2, 3, 4 and 5 on the path graph P_6, see the Maple program. - Johannes W. Meijer, May 29 2010
With offset 0 = the INVERT transform of A055588. - Gary W. Adamson, Apr 01 2011

Crossrefs

Programs

  • Magma
    [n le 3 select 3^(n-1) else 5*Self(n-1) -6*Self(n-2) +Self(n-3): n in [1..31]]; // G. C. Greubel, Feb 12 2023
    
  • Maple
    with(GraphTheory):G:=PathGraph(6): A:= AdjacencyMatrix(G): nmax:=24; n2:=2*nmax+1: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[k,1],k=1..5); od: seq(a(2*n+1),n=0..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    f[n_]:= FullSimplify[ TrigToExp[(2/7)Sum[ Sin[Pi*k/7]Sin[3Pi*k/7](2Cos[Pi*k/7] )^(2n), {k,6}]]];
    Table[f[n], {n, 25}] (* Robert G. Wilson v, Jun 18 2004 *)
    LinearRecurrence[{5,-6,1},{1,3,9},30] (* Harvey P. Dale, Nov 19 2019 *)
  • PARI
    Vec(x*(1-2*x)/(1-5*x+6*x^2-x^3)+O(x^99)) \\ Charles R Greathouse IV, Jun 14 2015
    
  • SageMath
    @CachedFunction
    def a(n): # a = A094790
        if (n<4): return 3^(n-1)
        else: return 5*a(n-1) - 6*a(n-2) + a(n-3)
    [a(n) for n in range(1,41)] # G. C. Greubel, Feb 12 2023

Formula

a(n) = (2/7)*Sum_{k=1..6} sin(Pi*k/7)*sin(3*Pi*k/7)*(2*cos(Pi*k/7))^(2n).
a(n) = 5*a(n-1) - 6*a(n-2) + a(n-3).
G.f.: x*(1-2*x)/(1 - 5*x + 6*x^2 - x^3).
a(n) = rightmost term in M^n * [1,0,0] where M = the 3 X 3 matrix [2,1,1; 1,2,0; 1,0,1]. E.g., M^3 * [1,0,0] = [19,14,9]; right term = 9 = a(3). - Gary W. Adamson, Apr 04 2006

A061551 Number of paths along a corridor width 8, starting from one side.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 69, 124, 241, 440, 846, 1560, 2977, 5525, 10490, 19551, 36994, 69142, 130532, 244419, 460737, 863788, 1626629, 3052100, 5743674, 10782928, 20283121, 38092457, 71632290, 134560491, 252989326, 475313762
Offset: 0

Views

Author

Henry Bottomley, May 16 2001

Keywords

Comments

Counts all paths of length n starting at initial node on the path graph P_8. - Paul Barry, May 11 2004
The a(n) represent the number of possible chess games, ignoring the fifty-move and the triple repetition rules, after n moves by White in the following position: White Ka1, pawns a2, b6, d2, d6 and g2; Black Ka8, Bc8, pawns a3, b7, d3, d7 and g3. - Johannes W. Meijer, May 29 2010
Define the 4 X 4 tridiagonal unit-primitive matrix (see [Jeffery]) M = A_{9,1} = [0,1,0,0; 1,0,1,0; 0,1,0,1; 0,0,1,1]; then a(n)=[M^n](4,4). - _L. Edson Jeffery, Mar 18 2011
a(n) is the length of n-th word derived by certain iterated substitutions on four letters {1,2,3,4} as follows. Define the substitution rules 1 -> {2}, 2 -> {1,3}, 3 -> {2,4}, 4 -> {3,4}, in which "," denotes concatenation, so 1 -> 2, 2 -> 13, 3 -> 24, 4 -> 34. Let w(k) be the k-th word formed by applying the substitution rules to each letter (digit) in word w(k-1), k>0, putting w(0) = 1. Then, for n=0,1,..., {w(n)} = {1, 2, 13, 224, 131334, 2242242434, 13133413133413342434, ...} in which {length(w(n))} = {1,1,2,3,6,10,...} = A061551. The maps 1 -> 2, etc., are given by the above matrix A_{9,1} by taking i -> {j : [A_{9,1}](i,j) <> 0}, i, j in {1,2,3,4}. Moreover, the entry in row 1 and column j of [A{9,1}]^n gives the relative frequency of the letter j in the n-th word w(n). Finally, the sum of the first-row entries of [A_{9,1}]^n again gives a(n), so obviously a(n) = sum of relative frequencies of each j in word w(n). - L. Edson Jeffery, Feb 06 2012
Range of row n of the circular Pascal array of order 9. - Shaun V. Ault, Jun 05 2014
In general, a(n,m) = (2^n/(m+1))*Sum_{r=1..m} (1-(-1)^r)*cos(Pi*r/(m+1))^n*(1+cos(Pi*r/(m+1))) gives the number of paths of length n starting at the initial node on the path graph P_m. Here we have m=8. - Herbert Kociemba, Sep 17 2020

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 35*x^7 + 69*x^8 + ....
		

Crossrefs

Narrower corridors effectively produce A000007, A000012, A016116, A000045, A038754, A028495, A030436, A061551, A178381, A336675, A336678.
An infinitely wide corridor (i.e., just one wall) would produce A001405.
Equivalently, the above mentioned corridor numbers are exactly the ranges of the circular Pascal array of order d = 2, 3, 4, 5, 6, 7, 8, respectively, and this is true for any natural number d greater than or equal to 2.
a(n) = A094718(8, n).
Cf. A030436 and A178381.

Programs

  • Maple
    a[0]:=1: a[1]:=1: a[2]:=2: a[3]:=3: a[4]:=6: a[5]:=10: a[6]:=20: a[7]:=35: for n from 8 to 33 do a[n]:=7*a[n-2]-15*a[n-4]+10*a[n-6]-a[n-8] od: seq(a[n],n=0..33); # Emeric Deutsch, Aug 14 2006
    with(GraphTheory): P:=8: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=33; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P); od: seq(a(n),n=0..nmax); # Johannes W. Meijer, May 29 2010
    X := j -> (-1)^(j/9) - (-1)^(1-j/9):
    a := k -> add((2 + X(j))*X(j)^k, j in [1, 3, 5, 7])/9:
    seq(simplify(a(n)), n=0..30); # Peter Luschny, Sep 17 2020
  • Mathematica
    LinearRecurrence[{1,3,-2,-1},{1,1,2,3},40] (* Harvey P. Dale, Dec 19 2011 *)
    a[n_,m_]:=2^(n+1)/(m+1) Module[{x=(Pi r)/(m+1)},Sum[Cos[x]^n (1+Cos[x]),{r,1,m,2}]]
    Table[a[n,8],{n,0,40}]//Round (* Herbert Kociemba, Sep 17 2020 *)

Formula

a(n) = sum(b(n,i)) where b(n,0) = b(n,9) = 0, b(0,1)=1, b(0, n)=0 if n!=1 and b(n,i) = b(n-1,i) + b(n+1,i) if 0 < n < 9.
From Emeric Deutsch, Aug 14 2006: (Start)
G.f.: (1-2*x^2)/((1-x)*(1-3*x^2-x^3)).
a(n) = 7*a(n-2) - 15*a(n-4) + 10*a(n-6) - a(n-8). (End)
a(2*n) = A094854(n) and a(2*n+1) = A094855(n). - Johannes W. Meijer, May 29 2010
a(n) = a(n-1) + 3*a(n-2) - 2*a(n-3) - a(n-4), for n > 3, with {a(k)}={1,1,2,3}, k=0,1,2,3. - L. Edson Jeffery, Mar 18 2011
a(n) = A187498(3*n + 2). - L. Edson Jeffery, Mar 18 2011
a(n) = A205573(3,n). - L. Edson Jeffery, Feb 06 2012
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 + x / (1 - x / (1 - x / (1 + x))))))). - Michael Somos, Feb 08 2015
a(n) = 2^n/9*Sum_{r=1..8} (1-(-1)^r)cos(Pi*r/9)^n*(1+cos(Pi*r/9)). - Herbert Kociemba, Sep 17 2020
Showing 1-10 of 26 results. Next