1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1
Offset: 0
A105523
Expansion of 1-x*c(-x^2) where c(x) is the g.f. of A000108.
Original entry on oeis.org
1, -1, 0, 1, 0, -2, 0, 5, 0, -14, 0, 42, 0, -132, 0, 429, 0, -1430, 0, 4862, 0, -16796, 0, 58786, 0, -208012, 0, 742900, 0, -2674440, 0, 9694845, 0, -35357670, 0, 129644790, 0, -477638700, 0, 1767263190, 0
Offset: 0
G.f. = 1 - x + x^3 - 2*x^5 + 5*x^7 - 14*x^9 + 42*x^11 - 132*x^13 + 429*x^15 + ...
-
m:=25; R:=PowerSeriesRing(Rationals(), m); Coefficients(R!((1 + 2*x - Sqrt(1+4*x^2))/(2*x))); // G. C. Greubel, Sep 16 2018
-
A105523_list := proc(n) local j, a, w; a := array(0..n); a[0] := 1;
for w from 1 to n do a[w]:=-a[w-1]+(-1)^w*add(a[j]*a[w-j-1],j=1..w-1) od; convert(a,list)end: A105523_list(40); # Peter Luschny, May 19 2011
-
a[n_?EvenQ] := 0; a[n_?OddQ] := 4^n*Gamma[n/2] / (Gamma[-n/2]*(n+1)!); a[0] = 1; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Nov 14 2011, after Vladimir Kruchinin *)
CoefficientList[Series[(1 + 2 x - Sqrt[1 + 4 x^2])/(2 x), {x, 0, 50}], x] (* Vincenzo Librandi, Nov 01 2014 *)
a[ n_] := SeriesCoefficient[ (1 + 2 x - Sqrt[ 1 + 4 x^2]) / (2 x), {x, 0, n}]; (* Michael Somos, Jun 17 2015 *)
a[ n_] := If[ n < 1, Boole[n == 0], a[n] = -2 a[n - 1] + Sum[ a[j] a[n - j - 1], {j, 0, n - 1}]]; (* Michael Somos, Jun 17 2015 *)
-
{a(n) = local(A); if( n<0, 0, n++; A = vector(n); A[1] = 1; for( k=2, n, A[k] = -2 * A[k-1] + sum( j=1, k-1, A[j] * A[k-j])); A[n])}; /* Michael Somos, Jul 24 2011 */
-
def A105523(n):
if is_even(n): return 0 if n>0 else 1
return -(sqrt(pi)*2^(n-1))/(gamma(1-n/2)*gamma((n+3)/2))
[A105523(n) for n in (0..29)] # Peter Luschny, Oct 31 2014
A227310
G.f.: 1/G(0) where G(k) = 1 + (-q)^(k+1) / (1 - (-q)^(k+1)/G(k+1) ).
Original entry on oeis.org
1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 3, 2, 3, 4, 4, 6, 7, 8, 11, 13, 16, 20, 24, 31, 37, 46, 58, 70, 88, 108, 133, 167, 204, 252, 315, 386, 479, 594, 731, 909, 1122, 1386, 1720, 2124, 2628, 3254, 4022, 4980, 6160, 7618, 9432, 11665, 14433, 17860, 22093, 27341, 33824, 41847, 51785, 64065, 79267
Offset: 0
From _Joerg Arndt_, Mar 08 2014: (Start)
The a(21) = 7 rough sandpiles are:
:
: 1: [ 1 2 1 2 1 2 1 2 1 2 3 2 1 ] (composition)
:
: o
: o o o o ooo
: ooooooooooooo (rendering of sandpile)
:
:
: 2: [ 1 2 1 2 1 2 1 2 3 2 1 2 1 ]
:
: o
: o o o ooo o
: ooooooooooooo
:
:
: 3: [ 1 2 1 2 1 2 3 2 1 2 1 2 1 ]
:
: o
: o o ooo o o
: ooooooooooooo
:
:
: 4: [ 1 2 1 2 3 2 1 2 1 2 1 2 1 ]
:
: o
: o ooo o o o
: ooooooooooooo
:
:
: 5: [ 1 2 3 2 1 2 1 2 1 2 1 2 1 ]
:
: o
: ooo o o o o
: ooooooooooooo
:
:
: 6: [ 1 2 3 2 3 4 3 2 1 ]
:
: o
: o ooo
: ooooooo
: ooooooooo
:
:
: 7: [ 1 2 3 4 3 2 3 2 1 ]
:
: o
: ooo o
: ooooooo
: ooooooooo
(End)
From _Joerg Arndt_, Mar 09 2014: (Start)
The A097331(9) = 14 such sandpiles with base length 9 are:
01: [ 1 2 1 2 1 2 1 2 1 ]
02: [ 1 2 1 2 1 2 3 2 1 ]
03: [ 1 2 1 2 3 2 3 2 1 ]
04: [ 1 2 1 2 3 2 1 2 1 ]
05: [ 1 2 1 2 3 4 3 2 1 ]
06: [ 1 2 3 2 1 2 3 2 1 ]
07: [ 1 2 3 2 1 2 1 2 1 ]
08: [ 1 2 3 2 3 2 1 2 1 ]
09: [ 1 2 3 2 3 2 3 2 1 ]
10: [ 1 2 3 4 3 2 1 2 1 ]
11: [ 1 2 3 2 3 4 3 2 1 ]
12: [ 1 2 3 4 3 2 3 2 1 ]
13: [ 1 2 3 4 3 4 3 2 1 ]
14: [ 1 2 3 4 5 4 3 2 1 ]
(End)
Cf.
A049346 (g.f.: 1 - 1/G(0), where G(k)= 1 + q^(k+1) / (1 - q^(k+1)/G(k+1) ) ).
Cf.
A226728 (g.f.: 1/G(0), where G(k) = 1 + q^(k+1) / (1 - q^(k+1)/G(k+2) ) ).
Cf.
A226729 (g.f.: 1/G(0), where G(k) = 1 - q^(k+1) / (1 - q^(k+1)/G(k+2) ) ).
Cf.
A006958 (g.f.: 1/G(0), where G(k) = 1 - q^(k+1) / (1 - q^(k+1)/G(k+1) ) ).
Cf.
A227309 (g.f.: 1/G(0), where G(k) = 1 - q^(k+1) / (1 - q^(k+2)/G(k+1) ) ).
-
N = 66; q = 'q + O('q^N);
G(k) = if(k>N, 1, 1 + (-q)^(k+1) / (1 - (-q)^(k+1) / G(k+1) ) );
gf = 1 / G(0);
Vec(gf)
-
N = 66; q = 'q + O('q^N);
F(q,y,k) = if(k>N, 1, 1/(1 - y*q^2 * F(q, q^2*y, k+1) ) );
Vec( 1 + q * F(q,q,0) ) \\ Joerg Arndt, Mar 09 2014
A117641
Number of 3-Motzkin paths of length n with no level steps at height 0.
Original entry on oeis.org
1, 0, 1, 3, 11, 42, 167, 684, 2867, 12240, 53043, 232731, 1031829, 4615542, 20805081, 94410363, 430945739, 1977366192, 9115261211, 42195093993, 196060049129, 914110333422, 4275222950221, 20051858039718, 94294269673861
Offset: 0
The a(4) = 11 paths are UUDD, UDUD and 9 of the form UXYD where each of X and Y are level steps in any of three colors.
-
R:=PowerSeriesRing(Rationals(), 30); Coefficients(R!( (1+3*x-Sqrt(1-6*x+5*x^2))/(2*x*(3+x)) )); // G. C. Greubel, Apr 04 2019
-
CoefficientList[ Series[(1 + 3x - Sqrt[1 - 6x + 5x^2])/(2x^2 + 6x), {x, 0, 25}], x] (* Robert G. Wilson v *)
-
a(n):=sum(3^(n-2*j)*binomial(n+1,j)*binomial(n-j-1,n-2*j),j,0,floor(n/2))/(n+1); /* Vladimir Kruchinin, Apr 04 2019 */
-
my(x='x+O('x^30)); Vec( (1+3*x-sqrt(1-6*x+5*x^2))/(2*x*(3+x)) ) \\ G. C. Greubel, Apr 04 2019
-
((1+3*x-sqrt(1-6*x+5*x^2))/(2*x*(3+x))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Apr 04 2019
A129176
Irregular triangle read by rows: T(n,k) is the number of Dyck words of length 2n having k inversions (n >= 0, k >= 0).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 3, 5, 5, 7, 7, 6, 4, 1, 1, 1, 2, 3, 5, 7, 9, 11, 14, 16, 16, 17, 14, 10, 5, 1, 1, 1, 2, 3, 5, 7, 11, 13, 18, 22, 28, 32, 37, 40, 44, 43, 40, 35, 25, 15, 6, 1, 1, 1, 2, 3, 5, 7, 11, 15, 20, 26, 34, 42, 53, 63, 73, 85, 96, 106, 113, 118, 118, 115, 102, 86, 65, 41, 21, 7, 1
Offset: 0
T(4,5) = 3 because we have 01010011, 01001101 and 00110101.
Triangle starts:
[0] 1;
[1] 1;
[2] 1, 1;
[3] 1, 1, 2, 1;
[4] 1, 1, 2, 3, 3, 3, 1;
[5] 1, 1, 2, 3, 5, 5, 7, 7, 6, 4, 1;
[6] 1, 1, 2, 3, 5, 7, 9, 11, 14, 16, 16, 17, 14, 10, 5, 1;
...
- Alois P. Heinz, Rows n = 0..40, flattened
- Brian Drake, Limits of areas under lattice paths, Discrete Math. 309 (2009), no. 12, 3936-3953.
- J. Furlinger and J. Hofbauer, q-Catalan numbers, J. Comb. Theory, A, 40, 248-264, 1985.
- M. Shattuck, Parity theorems for statistics on permutations and Catalan words, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 5, Paper A07, 2005.
-
P[0]:=1: for n from 0 to 8 do
P[n+1]:=sort(expand(sum(t^((i+1)*(n-i))*P[i]*P[n-i],i=0..n))) od:
for n from 1 to 9 do seq(coeff(P[n],t,j),j=0..n*(n-1)/2) od;
# yields sequence in triangular form
# second Maple program:
b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
`if`(x=0, 1, expand(b(x-1, y+1, t)*z^t+b(x-1, y-1, t+1))))
end:
T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0$2)):
seq(T(n), n=0..10); # Alois P. Heinz, Jun 10 2014
-
b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x == 0, 1, Expand[b[x-1, y+1, t]*z^t + b[x-1, y-1, t+1]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 0]]; Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, May 26 2015, after Alois P. Heinz *)
-
P(x, n) =
{
if ( n<=1, return(1) );
return( sum( i=0, n-1, P(x, i) * P(x, n-1 -i) * x^((i+1)*(n-1 -i)) ) );
}
for (n=0, 10, print( Vecrev( P(x,n) ) ) ); \\ Joerg Arndt, Jan 23 2024
-
\\ faster with memoization:
N=11;
VP=vector(N+1); VP[1] =VP[2] = 1; \\ one-based; memoization
P(n) = VP[n+1];
for (n=2, N, VP[n+1] = sum( i=0, n-1, P(i) * P(n-1 -i) * x^((i+1)*(n-1-i)) ) );
for (n=0, N, print( Vecrev( P(n) ) ) ); \\ Joerg Arndt, Jan 23 2024
-
from sage.combinat.q_analogues import qt_catalan_number
for n in (0..9): print(qt_catalan_number(n).substitute(q=1).coefficients())
# Peter Luschny, Mar 10 2020
A097332
Expansion of (1/(1-x))(1+2x/(1-x+sqrt(1-2x-3x^2))).
Original entry on oeis.org
1, 2, 3, 5, 9, 18, 39, 90, 217, 540, 1375, 3563, 9361, 24872, 66707, 180341, 490913, 1344380, 3701159, 10237541, 28436825, 79288844, 221836403, 622599626, 1752360041, 4945087838, 13988490339, 39658308815, 112666081617
Offset: 0
G.f. = 1 + 2*x + 3*x^2 + 5*x^3 + 9*x^4 + 18*x^5 + 39*x^6 + 90*x^7 + 217*x^8 + ...
-
CoefficientList[Series[1/(1-x)*(1+(2x)/(1-x+Sqrt[1-2x-3x^2])),{x,0,40}],x] (* Harvey P. Dale, May 03 2012 *)
a[ n_] := SeriesCoefficient[ (1 + x - Sqrt[1 - 2 x - 3 x^2]) / (2 x (1 - x)), {x, 0, n}]; (* Michael Somos, May 19 2014 *)
-
{a(n) = if( n<0, 0, polcoeff( (1 + x - sqrt(1 - 2*x - 3*x^2 + x^2 * O(x^n))) / (2 * x * (1 - x)), n))}; /* Michael Somos, May 19 2014 */
Comments