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 39 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

A325698 Numbers with as many even as odd prime indices, counted with multiplicity.

Original entry on oeis.org

1, 6, 14, 15, 26, 33, 35, 36, 38, 51, 58, 65, 69, 74, 77, 84, 86, 90, 93, 95, 106, 119, 122, 123, 141, 142, 143, 145, 156, 158, 161, 177, 178, 185, 196, 198, 201, 202, 209, 210, 214, 215, 216, 217, 219, 221, 225, 226, 228, 249, 262, 265, 278, 287, 291, 299
Offset: 1

Views

Author

Gus Wiseman, May 17 2019

Keywords

Comments

These are Heinz numbers of the integer partitions counted by A045931.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The integers in the multiplicative subgroup of positive rational numbers generated by the products of two consecutive primes (A006094). The sequence is closed under multiplication, prime shift (A003961), and - where the result is an integer - under division. Using these closures, all the terms can be derived from the presence of 6. For example, A003961(6) = 15, A003961(15) = 35, 6 * 35 = 210, 210/15 = 14. Closed also under A297845, since A297845 can be defined using squaring, prime shift and multiplication. - Peter Munn, Oct 05 2020

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    6: {1,2}
   14: {1,4}
   15: {2,3}
   26: {1,6}
   33: {2,5}
   35: {3,4}
   36: {1,1,2,2}
   38: {1,8}
   51: {2,7}
   58: {1,10}
   65: {3,6}
   69: {2,9}
   74: {1,12}
   77: {4,5}
   84: {1,1,2,4}
   86: {1,14}
   90: {1,2,2,3}
   93: {2,11}
   95: {3,8}
		

Crossrefs

Positions of 0's in A195017.
A257992(n) = A257991(n).
Closed under: A003961, A003991, A297845.
Subsequence of A028260, A332820.

Programs

  • Mathematica
    Select[Range[100],Total[Cases[If[#==1,{},FactorInteger[#]],{p_,k_}:>k*(-1)^PrimePi[p]]]==0&]
  • PARI
    is(n) = {my(v = vector(2), f = factor(n));for(i = 1, #f~,v[1 + primepi(f[i, 1])%2]+=f[i, 2]);v[1] == v[2]} \\ David A. Corneth, Oct 06 2020
    
  • Python
    from sympy import factorint, primepi
    def ok(n):
        v = [0, 0]
        for p, e in factorint(n).items(): v[primepi(p)%2] += e
        return v[0] == v[1]
    print([k for k in range(300) if ok(k)]) # Michael S. Branicky, Apr 16 2022 after David A. Corneth

A000246 Number of permutations in the symmetric group S_n that have odd order.

Original entry on oeis.org

1, 1, 1, 3, 9, 45, 225, 1575, 11025, 99225, 893025, 9823275, 108056025, 1404728325, 18261468225, 273922023375, 4108830350625, 69850115960625, 1187451971330625, 22561587455281875, 428670161650355625, 9002073394657468125, 189043541287806830625
Offset: 0

Views

Author

Keywords

Comments

Michael Reid (mreid(AT)math.umass.edu) points out that the e.g.f. for the number of permutations of odd order can be obtained from the cycle index for S_n, F(Y; X1, X2, X3, ... ) := e^(X1 Y + X2 Y^2/2 + X3 Y^3/3 + ... ) and is F(Y, 1, 0, 1, 0, 1, 0, ... ) = sqrt((1 + Y)/(1 - Y)).
a(n) appears to be the number of permutations on [n] whose up-down signature has nonnegative partial sums. For example, the up-down signature of (2,4,5,1,3) is (+1,+1,-1,+1) with nonnegative partial sums 1,2,1,2 and a(3)=3 counts (1,2,3), (1,3,2), (2,3,1). - David Callan, Jul 14 2006
This conjecture has been confirmed, see Bernardi, Duplantier, Nadeau link.
a(n) is the number of permutations of [n] for which all left-to-right minima occur in odd locations in the permutation. For example, a(3)=3 counts 123, 132, 231. Proof: For such a permutation of length 2n, you can append 1,2,..., or 2n+1 (2n+1 choices) and increase by 1 the original entries that weakly exceed the appended entry. This gives all such permutations of length 2n+1. But if the original length is 2n-1, you cannot append 1 (for then 1 would be a left-to-right min in an even location) so you can only append 2,3,..., or 2n (2n-1 choices). This count matches the given recurrence relation a(2n)=(2n-1)a(2n-1), a(2n+1)=(2n+1)a(2n). - David Callan, Jul 22 2008
a(n) is the n-th derivative of exp(arctanh(x)) at x = 0. - Michel Lagneau, May 11 2010
a(n) is the absolute value of the Moebius number of the odd partition poset on a set of n+1 points, where the odd partition poset is defined to be the subposet of the partition poset consisting of only partitions using odd part size (as well as the maximum element for n even). - Kenneth M Monks, May 06 2012
Number of permutations in S_n in which all cycles have odd length. - Michael Somos, Mar 17 2019
a(n) is the number of unranked labeled binary trees compatible with the binary labeled perfect phylogeny that, among possible two-leaf binary labeled perfect phylogenies for a sample of size n+2, is compatible with the smallest number of unranked labeled binary trees. - Noah A Rosenberg, Jan 16 2025

Examples

			For the Wallis numerators, denominators and partial products see A001900. - _Wolfdieter Lang_, Dec 06 2017
		

References

  • H.-D. Ebbinghaus et al., Numbers, Springer, 1990, p. 146.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 87.
  • 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

Bisections are A001818 and A079484.
Row sums of unsigned triangle A049218 and of A111594, A262125.
Main diagonal of A262124.
Cf. A002019.

Programs

  • Haskell
    a000246 n = a000246_list !! n
    a000246_list = 1 : 1 : zipWith (+)
       (tail a000246_list) (zipWith (*) a000246_list a002378_list)
    -- Reinhard Zumkeller, Feb 27 2012
    
  • Magma
    I:=[1,1]; [n le 2 select I[n] else Self(n-1)+(n^2-5*n+6)*Self(n-2): n in [1..30]]; // Vincenzo Librandi, May 02 2015
  • Maple
    a:= proc(n) option remember; `if`(n<2, 1,
          a(n-1) +(n-1)*(n-2)*a(n-2))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, May 14 2018
  • Mathematica
    a[n_] := a[n] = a[n-1]*(n+Mod[n, 2]-1); a[0] = 1; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 21 2011, after Pari *)
    a[n_] := a[n] = (n-2)*(n-3)*a[n-2] + a[n-1]; a[0] := 0; a[1] := 1; Table[a[i], {i, 0, 20}] (* or *)  RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(n-2)*(n-3)a[n-2]+a[n-1]}, a, {n, 20}] (* G. C. Greubel, May 01 2015 *)
    CoefficientList[Series[Sqrt[(1+x)/(1-x)], {x, 0, 20}], x]*Table[k!, {k, 0, 20}] (* Stefano Spezia, Oct 07 2018 *)
  • PARI
    a(n)=if(n<1,!n,a(n-1)*(n+n%2-1))
    
  • PARI
    Vec( serlaplace( sqrt( (1+x)/(1-x) + O(x^55) ) ) )
    
  • PARI
    a(n)=prod(k=3,n,k+k%2-1) \\ Charles R Greathouse IV, May 01 2015
    
  • PARI
    a(n)=(n!/(n\2)!>>(n\2))^2/if(n%2,n,1) \\ Charles R Greathouse IV, May 01 2015
    

Formula

E.g.f.: sqrt(1-x^2)/(1-x) = sqrt((1+x)/(1-x)).
a(2*k) = (2*k-1)*a(2*k-1), a(2*k+1) = (2*k+1)*a(2*k), for k >= 0, with a(0) = 1.
Let b(1)=0, b(2)=1, b(k+2)=b(k+1)/k + b(k); then a(n+1) = n!*b(n+2). - Benoit Cloitre, Sep 03 2002
a(n) = Sum_{k=0..floor((n-1)/2)} (2k)! * C(n-1, 2k) * a(n-2k-1) for n > 0. - Noam Katz (noamkj(AT)hotmail.com), Feb 27 2001
Also successive denominators of Wallis's approximation to Pi/2 (unreduced): 1/1 * 2/1 * 2/3 * 4/3 * 4/5 * 6/5 * 6/7 * .., for n >= 1.
D-finite with recurrence: a(n) = a(n-1) + (n-1)*(n-2)*a(n-2). - Benoit Cloitre, Aug 30 2003
a(n) is asymptotic to (n-1)!*sqrt(2*n/Pi). - Benoit Cloitre, Jan 19 2004
a(n) = n! * binomial(n-1, floor((n-1)/2)) / 2^(n-1), n > 0. - Ralf Stephan, Mar 22 2004
E.g.f.: e^atanh(x), a(n) = n!*Sum_{m=1..n} Sum_{k=m..n} 2^(k-m)*Stirling1(k,m) *binomial(n-1,k-1)/k!, n > 0, a(0)=1. - Vladimir Kruchinin, Dec 12 2011
G.f.: G(0) where G(k) = 1 + x*(4*k-1)/((2*k+1)*(x-1) - x*(x-1)*(2*k+1)*(4*k+1)/(x*(4*k+1) + 2*(x-1)*(k+1)/G(k+1))); (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Jul 24 2012
G.f.: 1 + x*(G(0) - 1)/(x-1) where G(k) = 1 - (2*k+1)/(1-x/(x - 1/(1 - (2*k+1)/(1-x/(x - 1/G(k+1) ))))); (continued fraction). - Sergei N. Gladkovskii, Jan 15 2013
G.f.: G(0), where G(k) = 1 + x*(2*k+1)/(1 - x*(2*k+1)/(x*(2*k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 07 2013
For n >= 1, a(2*n) = (2*n-1)!!^2, a(2*n+1) = (2*n+1)*(2*n-1)!!^2. - Vladimir Shevelev, Dec 01 2013
E.g.f.: arcsin(x) - sqrt(1-x^2) + 1 for a(0) = 0, a(1) = a(2) = a(3) = 1. - G. C. Greubel, May 01 2015
Sum_{n>1} 1/a(n) = (L_0(1) + L_1(1))*Pi/2, where L is the modified Struve function. - Peter McNair, Mar 11 2022
From Peter Bala, Mar 29 2024: (Start)
a(n) = n! * Sum_{k = 0..n} (-1)^(n+k)*binomial(1/2, k)*binomial(-1/2, n-k).
a(n) = (1/4^n) * (2*n)!/n! * hypergeom([-1/2, -n], [1/2 - n], -1).
a(n) = n!/2^n * A063886(n). (End)

A085362 a(0)=1; for n>0, a(n) = 2*5^(n-1) - (1/2)*Sum_{i=1..n-1} a(i)*a(n-i).

Original entry on oeis.org

1, 2, 8, 34, 150, 678, 3116, 14494, 68032, 321590, 1528776, 7301142, 35003238, 168359754, 812041860, 3926147730, 19022666310, 92338836390, 448968093320, 2186194166950, 10659569748370, 52037098259090, 254308709196660
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Jun 25 2003

Keywords

Comments

Number of bilateral Schroeder paths (i.e. lattice paths consisting of steps U=(1,1), D=(1,-1) and H=(2,0)) from (0,0) to (2n,0) and with no H-steps at even (zero, positive or negative) levels. Example: a(2)=8 because we have UDUD, UUDD, UHD, UDDU and their reflections in the x-axis. First differences of A026375. - Emeric Deutsch, Jan 28 2004
From G. C. Greubel, May 22 2020: (Start)
This sequence is part of a class of sequences, for m >= 0, with the properties:
a(n) = 2*m*(4*m+1)^(n-1) - (1/2)*Sum_{k=1..n-1} a(k)*a(n-k).
a(n) = Sum_{k=0..n} m^k * binomial(n-1, n-k) * binomial(2*k, k).
a(n) = (2*m) * Hypergeometric2F1(-n+1, 3/2; 2; -4*m), for n > 0.
n*a(n) = 2*((2*m+1)*n - (m+1))*a(n-1) - (4*m+1)*(n-2)*a(n-2).
(4*m + 1)^n = Sum_{k=0..n} Sum_{j=0..k} a(j)*a(k-j).
G.f.: sqrt( (1 - t)/(1 - (4*m+1)*t) ).
This sequence is the case of m=1. (End)

Crossrefs

Bisection of A026392.
Essentially the same as A026387.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 30); Coefficients(R!( Sqrt((1-x)/(1-5*x)) )); // G. C. Greubel, May 23 2020
    
  • Maple
    a := n -> `if`(n=0,1,2*hypergeom([3/2, 1-n], [2], -4)):
    seq(simplify(a(n)), n=0..22); # Peter Luschny, Jan 30 2017
  • Mathematica
    CoefficientList[Series[Sqrt[(1-x)/(1-5x)], {x, 0, 25}], x]
  • PARI
    my(x='x+O('x^66)); Vec(sqrt((1-x)/(1-5*x))) \\ Joerg Arndt, May 10 2013
    
  • Sage
    def A085362_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( sqrt((1-x)/(1-5*x)) ).list()
    A085362_list(30) # G. C. Greubel, May 23 2020

Formula

G.f.: sqrt((1-x)/(1-5*x)).
Sum_{i=0..n} (Sum_{j=0..i} a(j)*a(i-j)) = 5^n.
D-finite with recurrence: a(n) = (2*(3*n-2)*a(n-1)-5*(n-2)*a(n-2))/n; a(0)=1, a(1)=2. - Emeric Deutsch, Jan 28 2004
a(n) ~ 2*5^(n-1/2)/sqrt(Pi*n). - Vaclav Kotesovec, Oct 14 2012
G.f.: G(0), where G(k)= 1 + 4*x*(4*k+1)/( (4*k+2)*(1-x) - 2*x*(1-x)* (2*k+1)*(4*k+3)/(x*(4*k+3) + (1-x)*(k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 22 2013
a(n) = Sum_{k=0..n} binomial(2*k,k)*binomial(n-1,n-k). - Vladimir Kruchinin, May 30 2016
a(n) = 2*hypergeom([3/2, 1-n], [2], -4) for n>0. - Peter Luschny, Jan 30 2017
a(0) = 1; a(n) = (2/n) * Sum_{k=0..n-1} (n+k) * a(k). - Seiichi Manyama, Mar 28 2023
From Seiichi Manyama, Aug 22 2025: (Start)
a(n) = (1/4)^n * Sum_{k=0..n} 5^k * binomial(2*k,k) * binomial(2*(n-k),n-k)/(1-2*(n-k)).
a(n) = Sum_{k=0..n} (-1)^k * 5^(n-k) * binomial(2*k,k)/(1-2*k) * binomial(n-1,n-k). (End)

A325700 Numbers with as many distinct even as distinct odd prime indices.

Original entry on oeis.org

1, 6, 12, 14, 15, 18, 24, 26, 28, 33, 35, 36, 38, 45, 48, 51, 52, 54, 56, 58, 65, 69, 72, 74, 75, 76, 77, 86, 93, 95, 96, 98, 99, 104, 106, 108, 112, 116, 119, 122, 123, 135, 141, 142, 143, 144, 145, 148, 152, 153, 158, 161, 162, 172, 175, 177, 178, 185, 192
Offset: 1

Views

Author

Gus Wiseman, May 17 2019

Keywords

Comments

These are the Heinz numbers of the integer partitions counted by A241638.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    6: {1,2}
   12: {1,1,2}
   14: {1,4}
   15: {2,3}
   18: {1,2,2}
   24: {1,1,1,2}
   26: {1,6}
   28: {1,1,4}
   33: {2,5}
   35: {3,4}
   36: {1,1,2,2}
   38: {1,8}
   45: {2,2,3}
   48: {1,1,1,1,2}
   51: {2,7}
   52: {1,1,6}
   54: {1,2,2,2}
   56: {1,1,1,4}
   58: {1,10}
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],0==Total[(-1)^PrimePi/@First/@If[#==1,{},FactorInteger[#]]]&]

A007877 Period 4 zigzag sequence: repeat [0,1,2,1].

Original entry on oeis.org

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

Views

Author

Christopher Lam Cham Kee (Topher(AT)CyberDude.Com)

Keywords

Comments

Euler transform of finite sequence [2,-2,0,1]. - Michael Somos, Sep 17 2004
This is the r = 2 member in the r-family of sequences S_r(n) defined in A092184 where more information can be found.
a(n+1) is the transform of sqrt(1+2x)/sqrt(1-2x) (A063886) under the Chebyshev transformation A(x) -> (1/(1 + x^2))A(x/(1 + x^2)). See also A084099. - Paul Barry, Oct 12 2004
Multiplicative with a(2) = 2, a(2^e) = 0 if e >= 2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005
The e.g.f. of 1, 2, 1, 0, 1, 2, 1, 0, ... (shifted left, offset zero) is exp(x) + sin(x).
Binomial transform is A000749(n+2). - Wesley Ivan Hurt, Dec 30 2015
Decimal expansion of 11/909. - David A. Corneth, Dec 12 2016
Ternary expansion of 1/5. - J. Conrad, Aug 14 2017

Crossrefs

Period k zigzag sequences: A000035 (k=2), this sequence (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).

Programs

  • Magma
    &cat [[0,1,2,1]^^25]; // Vincenzo Librandi, Dec 27 2015
    
  • Maple
    A007877:=n->sqrt(n^2 mod 8); seq(A007877(n), n=0..100); # Wesley Ivan Hurt, Jan 01 2014
  • Mathematica
    f[n_] := Mod[n, 4] - Mod[n^3, 4] + Mod[n^2, 4] (* Or *)
    f[n_] := Mod[n, 2] + 2 Floor[Mod[n + 1, 4]/3] (* Or *)
    f[n_] := Switch[Mod[n, 4], 0, 0, 1, 1, 2, 2, 3, 1]; Array[f, 105, 0] (* Robert G. Wilson v, Aug 08 2011 *)
    Table[Sqrt[Mod[n^2,8]], {n,0,100}] (* Wesley Ivan Hurt, Jan 01 2014 *)
    LinearRecurrence[{1, -1, 1}, {0, 1, 2}, 80] (* Vincenzo Librandi, Dec 27 2015 *)
    PadRight[{},100,{0,1,2,1}] (* Harvey P. Dale, Oct 24 2023 *)
  • PARI
    a(n)=[0,1,2,1][1+n%4] \\ Jaume Oliver Lafont, Mar 27 2009
    
  • PARI
    concat(0, Vec(x*(1+x)/(1-x+x^2-x^3) + O(x^100))) \\ Altug Alkan, Dec 29 2015
    
  • Python
    def A007877(n): return (0,1,2,1)[n&3] # Chai Wah Wu, Jan 26 2023

Formula

Multiplicative with a(p^e) = 2 if p = 2 and e = 0; 0 if p = 2 and e > 0; 1 if p > 2. - David W. Wilson, Aug 01 2001
a(n) = -Sum_{k=0..n} (-1)^C(k+2, 2) (Offset -1). - Paul Barry, Jul 07 2003
a(n) = 1 - cos(n*Pi/2); a(n) = a(n-1) - a(n-2) + a(n-3) for n>2. - Lee Reeves (leereeves(AT)fastmail.fm), May 10 2004
a(n) = -a(n-2) + 2, n >= 2, a(0) = 0, a(1) = 1.
G.f.: x*(1+x)/((1-x)*(1+x^2)) = x*(1+x)/(1-x+x^2-x^3).
a(n) = 1 - T(n, 0) = 1 - A056594(n) with Chebyshev's polynomials T(n, x) of the first kind. Note that T(n, 0) = S(n, 0).
a(n) = b(n) + b(n-1), n >= 1, with b(n) := A021913(n+1) the partial sums of S(n,0) = U(n,0) = A056594(n) (Chebyshev's polynomials evaluated at x=0).
a(n) = 1 + (1/2){(-1)^[(n-1)/2] - (-1)^[n/2]}. - Ralf Stephan, Jun 09 2005
Non-reduced g.f.: x*(1+x)^2/(1-x^4). - Jaume Oliver Lafont, Mar 27 2009
a(n+1) = (S(n, sqrt(2)))^2, n >= 0, with the Chebyshev S-polynomials A049310. See the W. Lang link under A181878. - Wolfdieter Lang, Dec 15 2010
Dirichlet g.f. (1 + 1/2^s - 2/4^s)*zeta(s). - R. J. Mathar, Feb 24 2011
a(n) = (n mod 4) - (n^3 mod 4) + (n^2 mod 4). - Gary Detlefs, Apr 17 2011
a(n) = (n mod 2) + 2*floor(((n+1) mod 4)/3). - Gary Detlefs, Jul 19 2011
a(n) = sqrt(n^2 mod 8). - Wesley Ivan Hurt, Jan 01 2014
a(n) = (n AND 4*k+2)-(n AND 4*k+1) + 2*floor(((n+2) mod 4)/3), for any k. - Gary Detlefs, Jun 08 2014
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/2). - Wesley Ivan Hurt, Dec 26 2015
a(n) = a(n-4) for n >= 4. - Wesley Ivan Hurt, Sep 07 2022
a(n) = n - 2*floor(n/4) - 2*floor((n+1)/4). - Ridouane Oudra, Jan 22 2024
E.g.f.: exp(x) - cos(x). - Stefano Spezia, Aug 04 2025

Extensions

Chebyshev comments from Wolfdieter Lang, Sep 10 2004

A028329 Twice central binomial coefficients.

Original entry on oeis.org

2, 4, 12, 40, 140, 504, 1848, 6864, 25740, 97240, 369512, 1410864, 5408312, 20801200, 80233200, 310235040, 1202160780, 4667212440, 18150270600, 70690527600, 275693057640, 1076515748880, 4208197927440, 16466861455200, 64495207366200, 252821212875504, 991837065896208
Offset: 0

Views

Author

Keywords

Comments

Central elements in the even-Pascal triangle A028326.
If Y is a 3-subset of an 2n-set X then, for n>=3, a(n-1) is the number of (n+1)-subsets of X having at least two elements in common with Y. - Milan Janjic, Dec 16 2007
a(n) denotes the number of ways one can reach the (n,n) point in an n X n grid via the point (n-1, n-1) starting from (0,0) when moving right and up is allowed [From Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 29 2009]
It appears that a(n-1) is also the number of quivers in the mutation class of twisted types BD_n and CD_n for n >= 3. - Christian Stump, Nov 03 2010
This is the case m = n+1 in the Catalan's formula (2m)!*(2n)!/(m!*(m+n)!*n!) - see Umberto Scarpis in References. - Bruno Berselli, Apr 27 2012
From Ran Pan, Feb 01 2016: (Start)
a(n) is the number of North-East paths from (0,0) to (n+1,n+1) that bounce off the diagonal y = x an even number of times. Details can be found in Section 4.2 in Pan and Remmel's link.
a(n) is the number of North-East paths from (0,0) to (n+1,n+1) that cross the diagonal y = x an even number of times. Details can be found in Section 4.3 in Pan and Remmel's link. (End)

References

  • Umberto Scarpis, Sui numeri primi e sui problemi dell'analisi indeterminata in Questioni riguardanti le matematiche elementari, Nicola Zanichelli Editore (1924-1927, third Edition), page 11.

Crossrefs

Bisection of A047073, A063886.
First differences of A054113.

Programs

  • Magma
    [2*(n+1)*Catalan(n): n in [0..30]]; // G. C. Greubel, Jul 13 2024
    
  • Maple
    seq(add(binomial(2*n,n),k=1..2),n=0..23); # Zerinvary Lajos, Dec 14 2007
  • Mathematica
    Table[2Binomial[2n,n],{n,0,30}] (* Harvey P. Dale, Aug 08 2011 *)
  • PARI
    a(n)=2*binomial(2*n,n)
    
  • SageMath
    [2*binomial(2*n,n) for n in range(31)] # G. C. Greubel, Jul 13 2024

Formula

G.f.: 2/sqrt(1 - 4*x).
a(n) = 2*A000984(n).
a(n) = 2 * binomial(2*n, n).
a(n) = A100320(n) = A095660(2*n,n) for n > 0. - Reinhard Zumkeller, Apr 08 2012
G.f.: G(0), where G(k)= 1 + 1/(1 - 2*x*(2*k + 1)/(2*x*(2*k + 1) + (k + 1)/ G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 07 2013
a(n) = binomial(2*n+2, n+1) - A162551(n). - Ran Pan, Feb 01 2016
D-finite with recurrence: n*a(n) + 2*(-2*n+1)*a(n-1)=0. - R. J. Mathar, Jan 17 2020
E.g.f.: 2*exp(2*x)*BesselI(0, 2*x). - Stefano Spezia, May 11 2024

Extensions

Edited by Michael Somos, Sep 13 2003

A047072 Array A read by diagonals: A(h,k)=number of paths consisting of steps from (0,0) to (h,k) such that each step has length 1 directed up or right and no step touches the line y=x unless x=0 or x=h.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 3, 2, 2, 3, 1, 1, 4, 5, 4, 5, 4, 1, 1, 5, 9, 5, 5, 9, 5, 1, 1, 6, 14, 14, 10, 14, 14, 6, 1, 1, 7, 20, 28, 14, 14, 28, 20, 7, 1, 1, 8, 27, 48, 42, 28, 42, 48, 27, 8, 1, 1, 9, 35, 75, 90, 42, 42, 90, 75, 35, 9, 1
Offset: 0

Views

Author

Keywords

Examples

			Array, A(n, k), begins as:
  1, 1,  1,  1,  1,   1,   1,   1, ...;
  1, 2,  1,  2,  3,   4,   5,   6, ...;
  1, 1,  2,  2,  5,   9,  14,  20, ...;
  1, 2,  2,  4,  5,  14,  28,  48, ...;
  1, 3,  5,  5, 10,  14,  42,  90, ...;
  1, 4,  9, 14, 14,  28,  42, 132, ...;
  1, 5, 14, 28, 42,  42,  84, 132, ...;
  1, 6, 20, 48, 90, 132, 132, 264, ...;
Antidiagonals, T(n, k), begins as:
  1;
  1,  1;
  1,  2,  1;
  1,  1,  1,  1;
  1,  2,  2,  2,  1;
  1,  3,  2,  2,  3,  1;
  1,  4,  5,  4,  5,  4,  1;
  1,  5,  9,  5,  5,  9,  5,  1;
  1,  6, 14, 14, 10, 14, 14,  6,  1;
		

Crossrefs

The following are all versions of (essentially) the same Catalan triangle: A009766, A030237, A033184, A059365, A099039, A106566, A130020, A047072.

Programs

  • Magma
    b:= func< n | n eq 0 select 1 else 2*Catalan(n-1) >;
    function A(n,k)
      if k eq n then return b(n);
      elif k gt n then return Binomial(n+k-1, n) - Binomial(n+k-1, n-1);
      else return Binomial(n+k-1, k) - Binomial(n+k-1, k-1);
      end if; return A;
    end function;
    // [[A(n,k): k in [0..12]]: n in [0..12]];
    T:= func< n,k | A(n-k, k) >;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 13 2022
    
  • Mathematica
    A[, 0]= 1; A[0, ]= 1; A[h_, k_]:= A[h, k]= If[(k-1>h || k-1Jean-François Alcover, Mar 06 2019 *)
  • SageMath
    def A(n,k):
        if (k==n): return 2*catalan_number(n-1) + 2*int(n==0)
        elif (k>n): return binomial(n+k-1, n) - binomial(n+k-1, n-1)
        else: return binomial(n+k-1, k) - binomial(n+k-1, k-1)
    def T(n,k): return A(n-k, k)
    # [[A(n,k) for k in range(12)] for n in range(12)]
    flatten([[T(n,k) for k in range(n+1)] for n in range(12)]) # G. C. Greubel, Oct 13 2022

Formula

A(n, n) = 2*[n=0] - A002420(n),
A(n, n+1) = 2*A000108(n-1), n >= 1.
From G. C. Greubel, Oct 13 2022: (Start)
T(n, n-1) = A000027(n-2) + 2*[n<3], n >= 1.
T(n, n-2) = A000096(n-4) + 2*[n<5], n >= 2.
T(n, n-3) = A005586(n-6) + 4*[n<7] - 2*[n=3], n >= 3.
T(2*n, n) = 2*A000108(n-1) + 3*[n=0].
T(2*n-1, n-1) = T(2*n+1, n+1) = A000180(n).
T(3*n, n) = A025174(n) + [n=0]
Sum_{k=0..n} T(n, k) = 2*A063886(n-2) + [n=0] - 2*[n=1]
Sum_{k=0..n} (-1)^k * T(n, k) = A000007(n).
Sum_{k=0..floor(n/2)} T(n, k) = A047079(n). (End)

A026010 a(n) = number of (s(0), s(1), ..., s(n)) such that s(i) is a nonnegative integer and |s(i) - s(i-1)| = 1 for i = 1,2,...,n and s(0) = 2. Also a(n) = sum of numbers in row n+1 of array T defined in A026009.

Original entry on oeis.org

1, 2, 4, 7, 14, 25, 50, 91, 182, 336, 672, 1254, 2508, 4719, 9438, 17875, 35750, 68068, 136136, 260338, 520676, 999362, 1998724, 3848222, 7696444, 14858000, 29716000, 57500460, 115000920, 222981435, 445962870, 866262915, 1732525830, 3370764540
Offset: 0

Views

Author

Keywords

Comments

Conjecture: a(n) is the number of integer compositions of n + 2 in which the even parts appear as often at even positions as at odd positions (confirmed up to n = 19). - Gus Wiseman, Mar 17 2018

Examples

			The a(3) = 7 compositions of 5 in which the even parts appear as often at even positions as at odd positions are (5), (311), (131), (113), (221), (122), (11111). Missing are (41), (14), (32), (23), (212), (2111), (1211), (1121), (1112). - _Gus Wiseman_, Mar 17 2018
		

Crossrefs

Programs

  • Magma
    [(&+[Binomial(Floor((n+k)/2), Floor(k/2)): k in [0..n]]): n in [0..40]]; // G. C. Greubel, Nov 08 2018
  • Mathematica
    Array[Sum[Binomial[Floor[(# + k)/2], Floor[k/2]], {k, 0, #}] &, 34, 0] (* Michael De Vlieger, May 16 2018 *)
    Table[2^(-1 + n)*(((2 + 3*#)*Gamma[(1 + #)/2])/(Sqrt[Pi]*Gamma[2 + #/2]) &[n + Mod[n, 2]]), {n,0,40}] (* Peter Pein, Nov 08 2018 *)
    Table[(1/2)^((5 - (-1)^n)/2)*(6*n + 7 - 3*(-1)^n)*CatalanNumber[(2*n + 1 - (-1)^n)/4], {n, 0, 40}] (* G. C. Greubel, Nov 08 2018 *)
  • PARI
    vector(40, n, n--; sum(k=0,n, binomial(floor((n+k)/2), floor(k/2)))) \\ G. C. Greubel, Nov 08 2018
    

Formula

a(2*n) = ((3*n + 1)/(2*n + 1))*C(2*n + 1, n)= A051924(1+n), n>=0, a(2*n-1) = a(2*n)/2 = A097613(1+n), n >= 1. - Herbert Kociemba, May 08 2004
a(n) = Sum_{k=0..n} binomial(floor((n+k)/2), floor(k/2)). - Paul Barry, Jul 15 2004
Inverse binomial transform of A005774: (1, 3, 9, 26, 75, 216, ...). - Gary W. Adamson, Oct 22 2007
Conjecture: (n+3)*a(n) - 2*a(n-1) + (-5*n-3)*a(n-2) + 2*a(n-3) + 4*(n-3)*a(n-4) = 0. - R. J. Mathar, Jun 20 2013
a(n) = (1/2)^((5 - (-1)^n)/2)*(6*n + 7 - 3*(-1)^n)*Catalan((2*n + 1 - (-1)^n)/4), where Catalan is the Catalan number = A000108. - G. C. Greubel, Nov 08 2018

A007123 Number of connected unit interval graphs with n nodes; also number of bracelets (turnover necklaces) with n black beads and n-1 white beads.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 76, 232, 750, 2494, 8524, 29624, 104468, 372308, 1338936, 4850640, 17685270, 64834550, 238843660, 883677784, 3282152588, 12233309868, 45741634536, 171530482864, 644953425740, 2430975800876, 9183681736376, 34766785487152, 131873995933480
Offset: 1

Views

Author

Keywords

Comments

Also number of rooted planar general trees (of n vertices or n-1 edges) up to reflection. - Antti Karttunen, Aug 09 2002 (For the correspondence with bracelets, start by considering Raney's lemma as explained by Graham, Knuth & Patashnik.)
Number of connected lattice path matroids on n elements up to isomorphism.
a(n) = number of noncrossing set partitions of [n] up to reflection (i<->n+1-i). Example: a(4) counts 123, 1-23, 13-2, 1-2-3 but not 12-3 because it is the reflection of 1-23. - David Callan, Oct 08 2005
From Vladimir Shevelev, Apr 23 2011: (Start)
Also number of non-equivalent necklaces of n beads, each of which is painted by one of 2*n-1 colors.
The sequence solves the so-called Reis problem about convex k-gons in case N=2*n-1, k=n. H. Gupta (1979) gave a full solution; I gave a short proof of Gupta's result and showed an equivalence of this problem and each of the following problems: the problem of enumerating the bracelets of n beads of 2 colors, k of them black, and the problem of enumerating the necklaces of k beads, each painted by one of n colors.
a(n) is an essentially unimprovable upper estimate for the number of distinct values of the permanent in (0,1)-circulants of order 2*n-1 with n 1's in every row. (End)
The number of Dyck paths of semilength n-1 up to reversal; that is, the number of Dyck paths of semilength n-1, treating as identical a path and that path when traveled in reverse order. - Noah A Rosenberg, Jan 28 2019

Examples

			x + x^2 + 2*x^3 + 4*x^4 + 10*x^5 + 26*x^6 + 76*x^7 + 232*x^8 + 750*x^9 + ...
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 5.6.7.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 345 & 346.
  • R. W. Robinson, personal communication.
  • R. W. Robinson, Numerical implementation of graph counting algorithms, AGRC Grant, Math. Dept., Univ. Newcastle, Australia, 1980.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Occurs as row 164 in A073201.
Next-to-center columns of triangle A052307.
Equal to A001405 plus A006079.

Programs

  • Mathematica
    f[k_Integer, n_] := (Plus @@ (EulerPhi[ # ]Binomial[n/#, k/# ] & /@ Divisors[GCD[n, k]])/n + Binomial[(n - If[OddQ@n, 1, If[OddQ@k, 2, 0]])/2, (k - If[OddQ@k, 1, 0])/2])/2 (* Robert A. Russell, Sep 27 2004 *)
    Table[ f[n, 2n - 1], {n, 10}]
    (* Comment from Wouter Meeussen, Feb 02 2013, added by N. J. A. Sloane, Feb 02 2013: To get lists of the necklaces in Mathematica, use (if n=4, say):
    <
    				
  • PARI
    {a(n) = if( n<1, 0, (2 * binomial(n-1, (n-1)\2) + binomial(2*n, n) / (2*n - 1)) / 4)} /* Michael Somos, Apr 16 2012 */
    
  • Python
    from sympy import catalan, binomial, floor
    def a(n): return 1 if n==1 else (catalan(n - 1) + binomial(n - 1, floor((n - 1)/2)))/2 # Indranil Ghosh, Jun 03 2017

Formula

a(n+1) = (Catalan(n) + binomial(n, floor(n/2)))/2 = (A000108(n) + A001405(n))/2. - Antti Karttunen, Aug 09 2002
G.f.: (1 + 2*x - sqrt(1 - 4*x)*sqrt(1 - 4*x^2))/(4*sqrt(1 - 4*x^2)).
G.f.: (sqrt((1 + 2*x) / (1 - 2*x)) - sqrt(1 - 4*x)) / 4. - Michael Somos, Apr 16 2012
a(n) = (A063886(n) - A002420(n)) / 4. - Michael Somos, Apr 16 2012
D-finite with recurrence n*(n-1)*(n-4)*a(n) - 4*(n-1)*(n^2-5*n+5)*a(n-1) - 4*(n-2)*(n^2-7*n+11)*a(n-2) + 8*(2*n-7)*(n-2)*(n-3)*a(n-3)=0. - R. J. Mathar, Aug 22 2018

Extensions

Extended by Christian G. Bower
Edited by Jon E. Schoenfield, Feb 14 2015
Showing 1-10 of 39 results. Next