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.

Previous Showing 51-60 of 67 results. Next

A349154 Numbers k such that the k-th composition in standard order has sum equal to negative twice its alternating sum.

Original entry on oeis.org

0, 12, 160, 193, 195, 198, 204, 216, 240, 2304, 2561, 2563, 2566, 2572, 2584, 2608, 2656, 2752, 2944, 3074, 3077, 3079, 3082, 3085, 3087, 3092, 3097, 3099, 3102, 3112, 3121, 3123, 3126, 3132, 3152, 3169, 3171, 3174, 3180, 3192, 3232, 3265, 3267, 3270, 3276
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2021

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The terms and corresponding compositions begin:
       0: ()
      12: (1,3)
     160: (2,6)
     193: (1,6,1)
     195: (1,5,1,1)
     198: (1,4,1,2)
     204: (1,3,1,3)
     216: (1,2,1,4)
     240: (1,1,1,5)
    2304: (3,9)
    2561: (2,9,1)
    2563: (2,8,1,1)
    2566: (2,7,1,2)
    2572: (2,6,1,3)
    2584: (2,5,1,4)
		

Crossrefs

These compositions are counted by A224274 up to 0's.
Except for 0, a subset of A345919.
The positive version is A348614, reverse A349153.
An unordered version is A348617, counted by A001523.
The reverse version is A349155.
A positive unordered version is A349159, counted by A000712 up to 0's.
A000346 = even-length compositions with alt sum != 0, complement A001700.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, complement A345192.
A034871, A097805, and A345197 count compositions by alternating sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A116406 counts compositions with alternating sum >=0, ranked by A345913.
A138364 counts compositions with alternating sum 0, ranked by A344619.
Statistics of standard compositions:
- The compositions themselves are the rows of A066099.
- Number of parts is given by A000120, distinct A334028.
- Sum and product of parts are given by A070939 and A124758.
- Maximum and minimum parts are given by A333766 and A333768.
Classes of standard compositions:
- Partitions and strict partitions are ranked by A114994 and A333256.
- Multisets and sets are ranked by A225620 and A333255.
- Strict and constant compositions are ranked by A233564 and A272919.
- Carlitz compositions are ranked by A333489, complement A348612.
- Necklaces are ranked by A065609, dual A333764, reversed A333943.
- Alternating compositions are ranked by A345167, complement A345168.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],Total[stc[#]]==-2*ats[stc[#]]&]

A136439 Sum of heights of all 1-watermelons with wall of length 2*n.

Original entry on oeis.org

1, 3, 10, 34, 118, 417, 1495, 5421, 19838, 73149, 271453, 1012872, 3797228, 14294518, 54006728, 204702328, 778115558, 2965409556, 11327549778, 43361526366, 166306579062, 638969153207, 2458973656584, 9477124288144, 36576265716636, 141344492073392, 546860238004919
Offset: 1

Views

Author

Steven Finch, Apr 02 2008

Keywords

Comments

a(n) is the sum of heights of all Dyck excursions of length 2*n (nonnegative walks beginning and ending at 0 with jumps -1,+1).

References

  • N. G. de Bruijn, D. E. Knuth and S. O. Rice, The average height of planted plane trees, in: Graph Theory and Computing (ed. T. C. Read), Academic Press, New York, 1972, pp. 15-22.

Crossrefs

Programs

  • Maple
    H[0]:=1: for k to 30 do H[k]:=simplify(1/(1-z*H[k-1])) end do: g:=sum(j*(H[j]-H[j-1]),j=1..30): gser:=series(g,z=0,27): seq(coeff(gser,z,n),n=1..24); # Emeric Deutsch, Apr 13 2008
    # second Maple program:
    b:= proc(x, y, h) option remember; `if`(x=0, h, add(`if`(x+j>y,
          b(x-1, y-j, max(h, y-j)), 0), j={$-1..min(1, y)} minus {0}))
        end:
    a:= n-> b(2*n, 0$2):
    seq(a(n), n=1..33);  # Alois P. Heinz, Mar 24 2020
  • Mathematica
    c[n_] := (2*n)!/(n!*(n+1)!)
    s[n_,a_] := Sum[If[k < 1, 0, DivisorSigma[0,k]*Binomial[2*n,n+a-k]/Binomial[2*n,n]], {k,a-n,a+n}]
    h[n_] := (n+1)*(s[n,1]-2*s[n,0]+s[n,-1]) - 1
    a[n_] := h[n]*c[n]
  • PARI
    \\ Translation of Mathematica code
    s(n,a)=sum(k=1,a+n, numdiv(k)*binomial(2*n,n+a-k))/binomial(2*n,n)
    a(n)=((n+1)*(s(n,1)-2*s(n,0)+s(n,-1))-1)*binomial(2*n,n)/(n+1) \\ Charles R Greathouse IV, Mar 28 2016

Formula

G.f.: Sum_{k >= 1} k*(H[k]-H[k-1]), where H[0]=1 and H[k]=1/(1-zH[k-1]) for k=1,2,... (the first Maple program makes use of this g.f.). - Emeric Deutsch, Apr 13 2008

Extensions

More terms from Alois P. Heinz, Mar 24 2020

A258143 Row sums of A257241, Stifel's version of the arithmetical triangle.

Original entry on oeis.org

1, 2, 6, 10, 25, 41, 98, 162, 381, 637, 1485, 2509, 5811, 9907, 22818, 39202, 89845, 155381, 354521, 616665, 1401291, 2449867, 5546381, 9740685, 21977515, 38754731, 87167163, 154276027, 345994215, 614429671, 1374282018, 2448023842, 5461770405, 9756737701, 21717436833
Offset: 1

Views

Author

Wolfdieter Lang, May 22 2015

Keywords

Comments

a(n) is the number of nonempty subsets of {1,2,...,n} that contain either more odd than even numbers or the same number of odd and even numbers. For example, for n=4, a(4)=10 and the 10 subsets are {1}, {3}, {1,3}, {1,2,3}, {1,3,4}; {1,2}, {1,4}, {2,3}, {3,4}, {1,2,3,4}. - Enrique Navarrete, Dec 16 2019

Examples

			n=3: a(3) = 2^3 - (1 + A008549(1)) = 8 - (1 + 1) = 6.
n=4: a(4) = 2^4 - (1 + A000346(1)) = 16 - (1 +  5) = 10.
		

Crossrefs

Programs

  • Haskell
    a258143 = sum . a257241_row  -- Reinhard Zumkeller, May 22 2015
  • Mathematica
    Table[Sum[Binomial[n, m], {m, Ceiling[n/2]}], {n, 50}] (* Paolo Xausa, Nov 14 2024 *)

Formula

a(n) = Sum_{m = 1 .. ceiling(n/2)} binomial(n, m), n >= 1.
a(n) = 2^n - 2 - Sum_{i=1..floor(n/2)-1} binomial(n, i), n >= 2; a(1)=1. - Enrique Navarrete, Dec 16 2019
a(2*k+1) = 2^(2*k+1) - (1 + A008549(k)), k >= 0.
a(2*k) = 2^(2*k) - (1 + A000346(k-1)), k >= 1.
O.g.f.: x*(2+3*x+x^2 - (1-x^2)*(1+x)*c(x^2))/((1-(2*x)^2)*(1-x^2)) where c(x) is the o.g.f. of A000108.
O.g.f. for a(2*k+1), k >= 0: (2+x - (1-x)*c(x))/ ((1-4*x)*(1-x)).
O.g.f. for a(2*(k+1)), k >= 0: (3 - (1-x)*c(x))/ ((1-4*x)*(1-x)).
a(n) = A116406(n+1) - 1. - Hugo Pfoertner, Nov 14 2024

A296770 Row sums of A050158.

Original entry on oeis.org

1, 5, 24, 111, 500, 2210, 9632, 41531, 177564, 754014, 3184016, 13382710, 56026984, 233765636, 972504704, 4035441491, 16707488684, 69033916166, 284733161264, 1172510645666, 4821324991064, 19799091571676, 81208982686784, 332726301861086, 1361862906980120
Offset: 0

Views

Author

Peter Luschny, Dec 22 2017

Keywords

Crossrefs

Programs

  • Maple
    A296770 := n -> add(binomial(2*n+1, n+1) - binomial(2*n+1, n-k-1), k=0..n):
    seq(A296770(n), n=0..24);
  • Mathematica
    a[n_] := 4^n ((2 (2 + n) Gamma[3/2 + n])/(Sqrt[Pi] Gamma[2 + n]) - 1);
    Table[a[n], {n, 0, 24}]

Formula

a(n) = Sum_{k=0..n} (binomial(2*n+1, n+1) - binomial(2*n+1, n-k-1)).
a(n) = 4^n*((2*(n + 2)*Gamma(n + 3/2))/(sqrt(Pi)*Gamma(n + 2)) - 1).
a(n) = (n/2+1)*binomial(2*(n+1), n+1) - 4^n.
a(n) ~ 4^n*(2*sqrt(n/Pi) - 1).
a(n) = A002457(n) - A008549(n).

A343943 Number of distinct possible alternating sums of permutations of the multiset of prime factors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 4, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Aug 19 2021

Keywords

Comments

First differs from A096825 at a(525) = 3, A096825(525) = 4.
First differs from A345926 at a(90) = 4, A345926(90) = 3.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. Of course, the alternating sum of prime factors is also the reverse-alternating sum of reversed prime factors.
Also the number of distinct "sums of prime factors" of divisors d|n such that bigomega(d) = bigomega(n)/2 rounded up.

Examples

			The divisors of 525 with 2 prime factors are: 15, 21, 25, 35, with prime factors {3,5}, {3,7}, {5,5}, {5,7}, with distinct sums {8,10,12}, so a(525) = 3.
		

Crossrefs

The half-length submultisets are counted by A114921.
Including all multisets of prime factors gives A305611(n) + 1.
The strict rounded version appears to be counted by A342343.
The version for prime indices instead of prime factors is A345926.
A000005 counts divisors, which add up to A000203.
A001414 adds up prime factors, row sums of A027746.
A056239 adds up prime indices, row sums of A112798.
A071321 gives the alternating sum of prime factors (reverse: A071322).
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A108917 counts knapsack partitions, ranked by A299702.
A276024 and A299701 count positive subset-sums of partitions.
A316524 gives the alternating sum of prime indices (reverse: A344616).
A334968 counts subsequence-sums of standard compositions.

Programs

  • Mathematica
    prifac[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[Length[Union[Total/@Subsets[prifac[n],{Ceiling[PrimeOmega[n]/2]}]]],{n,100}]
  • Python
    from sympy import factorint
    from sympy.utilities.iterables import multiset_combinations
    def A343943(n):
        fs = factorint(n)
        return len(set(sum(d) for d in multiset_combinations(fs,(sum(fs.values())+1)//2))) # Chai Wah Wu, Aug 23 2021

A346194 Total sum of the left-to-right strict peak maxima in all Dyck paths of semilength n.

Original entry on oeis.org

0, 1, 3, 11, 40, 148, 555, 2100, 7997, 30605, 117602, 453421, 1753176, 6795248, 26393431, 102702230, 400277998, 1562292741, 6105426033, 23887275883, 93554945414, 366754396228, 1438986625349, 5650409534767, 22203298031827, 87306238753663, 343511939707274
Offset: 0

Views

Author

Alois P. Heinz, Jul 09 2021

Keywords

Comments

Sum of all peak heights in Dyck paths of semilength n is A000302(n-1) for n>0.
Sum of all heights in Dyck paths of semilength n is A008549(n).

Examples

			a(3) = 1 + (1+2) + 2 + 2 + 3 = 11:
                                         /\
                  /\    /\      /\/\    /  \
       /\/\/\  /\/  \  /  \/\  /    \  /    \ .
		

Crossrefs

Programs

  • Maple
    b:= proc(x, y, t, h) option remember; `if`(x=0, [1, 0], `if`(y>0,
         (p-> p+[0, `if`(t=1, p[1]*h, 0)])(b(x-1, y-1, 0, h)), 0)+
         `if`(yh, 1, 0), max(h, y+1)), 0))
        end:
    a:= n-> b(2*n, 0$3)[2]:
    seq(a(n), n=0..32);
  • Mathematica
    b[x_, y_, t_, h_] := b[x, y, t, h] = If[x == 0, {1, 0}, If[y > 0,
       With[{p = b[x-1, y-1, 0, h]}, p+{0, If[t == 1, p[[1]]*h, 0]}]], {0, 0}]+
       If[y < x - 1, b[x-1, y+1, If[y+1 > h, 1, 0], Max[h, y+1]], {0, 0}] /.
       Null -> 0;
    a[n_] := b[2*n, 0, 0, 0][[2]];
    Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Apr 04 2022, after Alois P. Heinz *)

A346195 Total sum of the left-to-right weak peak maxima in all Dyck paths of semilength n.

Original entry on oeis.org

0, 1, 4, 15, 57, 218, 837, 3224, 12455, 48244, 187307, 728692, 2839877, 11084756, 43325744, 169548783, 664229072, 2604770882, 10223744018, 40161025704, 157878855072, 621070768564, 2444741008686, 9628942865104, 37945470536353, 149609922922904, 590153796979867
Offset: 0

Views

Author

Alois P. Heinz, Jul 09 2021

Keywords

Comments

Sum of all peak heights in Dyck paths of semilength n is A000302(n-1) for n>0.
Sum of all heights in Dyck paths of semilength n is A008549(n).

Examples

			a(3) = (1+1+1) + (1+2) + 2 + (2+2) + 3 = 15:
                                         /\
                  /\    /\      /\/\    /  \
       /\/\/\  /\/  \  /  \/\  /    \  /    \ .
		

Crossrefs

Programs

  • Maple
    b:= proc(x, y, t, h) option remember; `if`(x=0, [1, 0], `if`(y>0,
         (p-> p+[0, `if`(t=1, p[1]*h, 0)])(b(x-1, y-1, 0, h)), 0)+
         `if`(y=h, 1, 0), max(h, y+1)), 0))
        end:
    a:= n-> b(2*n, 0$3)[2]:
    seq(a(n), n=0..32);
  • Mathematica
    b[x_, y_, t_, h_] := b[x, y, t, h] = If[x == 0, {1, 0}, If[y > 0,
         Function[p, p + {0, If[t == 1, p[[1]]*h, 0]}][b[x-1, y-1, 0, h]], 0] +
         If[y < x-1, b[x-1, y+1, If[y+1 >= h, 1, 0], Max[h, y+1]], 0]];
    a[n_] := b[2*n, 0, 0, 0][[2]];
    Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Jun 04 2022, after Alois P. Heinz *)

A346632 Triangle read by rows giving the main diagonals of the matrices counting integer compositions by length and alternating sum (A345197).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 1, 2, 3, 0, 0, 0, 1, 2, 6, 6, 0, 0, 0, 1, 2, 9, 12, 0, 0, 0, 0, 1, 2, 12, 18, 10, 0, 0, 0, 0, 1, 2, 15, 24, 30, 20, 0, 0, 0, 0, 1, 2, 18, 30, 60, 60, 0, 0, 0, 0, 0, 1, 2, 21, 36, 100, 120, 35, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			Triangle begins:
   1
   0   0
   0   1   0
   0   1   2   0
   0   1   2   0   0
   0   1   2   3   0   0
   0   1   2   6   6   0   0
   0   1   2   9  12   0   0   0
   0   1   2  12  18  10   0   0   0
   0   1   2  15  24  30  20   0   0   0
   0   1   2  18  30  60  60   0   0   0   0
   0   1   2  21  36 100 120  35   0   0   0   0
   0   1   2  24  42 150 200 140  70   0   0   0   0
   0   1   2  27  48 210 300 350 280   0   0   0   0   0
   0   1   2  30  54 280 420 700 700 126   0   0   0   0   0
		

Crossrefs

The first nonzero element in each column appears to be A001405.
These are the diagonals of the matrices given by A345197.
Antidiagonals of the same matrices are A345907.
Row sums are A345908.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],k==(n+ats[#])/2&]],{k,n}],{n,0,15}]

A349153 Numbers k such that the k-th composition in standard order has sum equal to twice its reverse-alternating sum.

Original entry on oeis.org

0, 11, 12, 14, 133, 138, 143, 148, 155, 158, 160, 168, 179, 182, 188, 195, 198, 204, 208, 216, 227, 230, 236, 240, 248, 2057, 2066, 2071, 2077, 2084, 2091, 2094, 2101, 2106, 2111, 2120, 2131, 2134, 2140, 2149, 2154, 2159, 2164, 2171, 2174, 2192, 2211, 2214
Offset: 1

Views

Author

Gus Wiseman, Nov 17 2021

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.

Examples

			The terms and corresponding compositions begin:
    0: ()
   11: (2,1,1)
   12: (1,3)
   14: (1,1,2)
  133: (5,2,1)
  138: (4,2,2)
  143: (4,1,1,1,1)
  148: (3,2,3)
  155: (3,1,2,1,1)
  158: (3,1,1,1,2)
  160: (2,6)
  168: (2,2,4)
  179: (2,1,3,1,1)
  182: (2,1,2,1,2)
  188: (2,1,1,1,3)
		

Crossrefs

These compositions are counted by A262977 up to 0's.
Except for 0, a subset of A345917.
The unreversed version is A348614.
The unreversed negative version is A349154.
The negative version is A349155.
A non-reverse unordered version is A349159, counted by A000712 up to 0's.
An unordered version is A349160, counted by A006330 up to 0's.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, complement A345192.
A034871, A097805, and A345197 count compositions by alternating sum.
A103919 counts partitions by alternating sum, reverse A344612.
A116406 counts compositions with alternating sum >=0, ranked by A345913.
A138364 counts compositions with alternating sum 0, ranked by A344619.
Statistics of standard compositions:
- The compositions themselves are the rows of A066099.
- Number of parts is given by A000120, distinct A334028.
- Sum and product of parts are given by A070939 and A124758.
- Maximum and minimum parts are given by A333766 and A333768.
- Heinz number is given by A333219.
Classes of standard compositions:
- Partitions and strict partitions are ranked by A114994 and A333256.
- Multisets and sets are ranked by A225620 and A333255.
- Strict and constant compositions are ranked by A233564 and A272919.
- Carlitz compositions are ranked by A333489, complement A348612.
- Alternating compositions are ranked by A345167, complement A345168.

Programs

  • Mathematica
    stc[n_]:=Differences[ Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}];
    Select[Range[0,1000],Total[stc[#]]==2*sats[stc[#]]&]

A041001 Convolution of A000108(n+1), n >= 0, (Catalan numbers) with A038845 (3-fold convolution of powers of 4).

Original entry on oeis.org

1, 14, 125, 906, 5810, 34364, 191901, 1026610, 5312230, 26767940, 131990066, 639210404, 3048892740, 14354652152, 66828135005, 308078809794, 1408022619806, 6385966846580, 28765327498278, 128777533131500
Offset: 0

Views

Author

Keywords

Comments

Also convolution of A038836 with A000984 (central binomial coefficients); also convolution of A001791(n+1), n >= 0, with A002802; also convolution of A008549(n+1), n >= 0, with A002697; also convolution of A029760 with A002457; also convolution of A038806(n+1), n >= 0, with A000302 (powers of 4).

Formula

a(n) = (n+3)*(3*(n+6)*2^(2*n+3)-(n+4)*binomial(2*n+7, n+3))/12; G.f. (c(x)^2)/(1-4*x)^3, where c(x) = g.f. for Catalan numbers.
Previous Showing 51-60 of 67 results. Next