A159985 Erroneous version of A259667.
1, 1, 2, 5, 2, 0, 0, 3, 2, 2, 2, 2, 4
Offset: 0
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.
From _Joerg Arndt_ and Greg Stevenson, Jul 11 2011: (Start) The following products of 3 transpositions lead to a 4-cycle in S_4: (1,2)*(1,3)*(1,4); (1,2)*(1,4)*(3,4); (1,3)*(1,4)*(2,3); (1,4)*(2,3)*(2,4); (1,4)*(2,4)*(3,4). (End) G.f. = 1 + x + 2*x^2 + 5*x^3 + 14*x^4 + 42*x^5 + 132*x^6 + 429*x^7 + ... For n=3, a(3)=5 since there are exactly 5 binary sequences of length 7 in which the number of ones first exceed the number of zeros at entry 7, namely, 0001111, 0010111, 0011011, 0100111, and 0101011. - _Dennis P. Walsh_, Apr 11 2012 From _Joerg Arndt_, Jun 30 2014: (Start) The a(4) = 14 branching sequences of the (ordered) trees with 4 non-root nodes are (dots denote zeros): 01: [ 1 1 1 1 . ] 02: [ 1 1 2 . . ] 03: [ 1 2 . 1 . ] 04: [ 1 2 1 . . ] 05: [ 1 3 . . . ] 06: [ 2 . 1 1 . ] 07: [ 2 . 2 . . ] 08: [ 2 1 . 1 . ] 09: [ 2 1 1 . . ] 10: [ 2 2 . . . ] 11: [ 3 . . 1 . ] 12: [ 3 . 1 . . ] 13: [ 3 1 . . . ] 14: [ 4 . . . . ] (End)
A000108:=List([0..30],n->Binomial(2*n,n)/(n+1)); # Muniru A Asiru, Feb 17 2018
import Data.List (genericIndex) a000108 n = genericIndex a000108_list n a000108_list = 1 : catalan [1] where catalan cs = c : catalan (c:cs) where c = sum $ zipWith (*) cs $ reverse cs -- Reinhard Zumkeller, Nov 12 2011 a000108 = map last $ iterate (scanl1 (+) . (++ [0])) [1] -- David Spies, Aug 23 2015
C:= func< n | Binomial(2*n,n)/(n+1) >; [ C(n) : n in [0..60]];
[Catalan(n): n in [0..40]]; // Vincenzo Librandi, Apr 02 2011
A000108 := n->binomial(2*n,n)/(n+1); G000108 := (1 - sqrt(1 - 4*x)) / (2*x); spec := [ A, {A=Prod(Z,Sequence(A))}, unlabeled ]: [ seq(combstruct[count](spec, size=n+1), n=0..42) ]; with(combstruct): bin := {B=Union(Z,Prod(B,B))}: seq(count([B,bin,unlabeled],size=n+1), n=0..25); # Zerinvary Lajos, Dec 05 2007 gser := series(G000108, x=0, 42): seq(coeff(gser, x, n), n=0..41); # Zerinvary Lajos, May 21 2008 seq((2*n)!*coeff(series(hypergeom([],[2],x^2),x,2*n+2),x,2*n),n=0..30); # Peter Luschny, Jan 31 2015 A000108List := proc(m) local A, P, n; A := [1, 1]; P := [1]; for n from 1 to m - 2 do P := ListTools:-PartialSums([op(P), A[-1]]); A := [op(A), P[-1]] od; A end: A000108List(31); # Peter Luschny, Mar 24 2022
Table[(2 n)!/n!/(n + 1)!, {n, 0, 20}] Table[4^n Gamma[n + 1/2]/(Sqrt[Pi] Gamma[n + 2]), {n, 0, 20}] (* Eric W. Weisstein, Oct 31 2024 *) Table[Hypergeometric2F1[1 - n, -n, 2, 1], {n, 0, 20}] (* Richard L. Ollerton, Sep 13 2006 *) Table[CatalanNumber @ n, {n, 0, 20}] (* Robert G. Wilson v, Feb 15 2011 *) CatalanNumber[Range[0, 20]] (* Eric W. Weisstein, Oct 31 2024 *) CoefficientList[InverseSeries[Series[x/Sum[x^n, {n, 0, 31}], {x, 0, 31}]]/x, x] (* Mats Granvik, Nov 24 2013 *) CoefficientList[Series[(1 - Sqrt[1 - 4 x])/(2 x), {x, 0, 20}], x] (* Stefano Spezia, Aug 31 2018 *)
A000108(n):=binomial(2*n,n)/(n+1)$ makelist(A000108(n),n,0,30); /* Martin Ettl, Oct 24 2012 */
combinat::dyckWords::count(n) $ n = 0..38 // Zerinvary Lajos, Apr 14 2007
a(n)=binomial(2*n,n)/(n+1) \\ M. F. Hasler, Aug 25 2012
a(n) = (2*n)! / n! / (n+1)!
a(n) = my(A, m); if( n<0, 0, m=1; A = 1 + x + O(x^2); while(m<=n, m*=2; A = sqrt(subst(A, x, 4*x^2)); A += (A - 1) / (2*x*A)); polcoeff(A, n));
{a(n) = if( n<1, n==0, polcoeff( serreverse( x / (1 + x)^2 + x * O(x^n)), n))}; /* Michael Somos */
(recur(a,b)=if(b<=2,(a==2)+(a==b)+(a!=b)*(1+a/2), (1+a/b)*recur(a,b-1))); a(n)=recur(n,n); \\ R. J. Cano, Nov 22 2012
x='x+O('x^40); Vec((1-sqrt(1-4*x))/(2*x)) \\ Altug Alkan, Oct 13 2015
from gmpy2 import divexact A000108 = [1, 1] for n in range(1, 10**3): A000108.append(divexact(A000108[-1]*(4*n+2),(n+2))) # Chai Wah Wu, Aug 31 2014
# Works in Sage also. A000108 = [1] for n in range(1000): A000108.append(A000108[-1]*(4*n+2)//(n+2)) # Günter Rote, Nov 08 2023
[catalan_number(i) for i in range(27)] # Zerinvary Lajos, Jun 26 2008
# Generalized algorithm of L. Seidel def A000108_list(n) : D = [0]*(n+1); D[1] = 1 b = True; h = 1; R = [] for i in range(2*n-1) : if b : for k in range(h,0,-1) : D[k] += D[k-1] h += 1; R.append(D[1]) else : for k in range(1,h, 1) : D[k] += D[k+1] b = not b return R A000108_list(31) # Peter Luschny, Jun 02 2012
a(0)=0. Let m=3. Then f(m)=5, f^2(m)=1. The corresponding numbers n=(m-1)/2 are 1,2,0. By the condition, a(1) > a(2) > a(0)=0. Therefore let a(2)=1, a(1)=2. Furthermore, consider m=7. Then f(m)=11, f^2(m)=17, f^3(m)=13, f^4(m)=5. The corresponding numbers n=(m-1)/2 are 3,5,8,6,2 and, by the condition, a(3) > a(5) > a(8) > a(6) > a(2)=1. Therefore set a(6)=3 (the minimal value which yet did not appear), a(8)=4, a(5)=5, a(3)=6, etc.
Put a(0)=0. According to example to A160348, in the first series we find A160348(1) and A160348(2), therefore a(1)=a(2)=1. In the second series we find A160348(3), A160348(5), A160348(6) and A160348(8), thus a(3)=a(5)=a(6)=a(8)=2.
Comments