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-5 of 5 results.

A374726 Number of gap-free Carlitz compositions of n.

Original entry on oeis.org

1, 1, 3, 2, 4, 9, 11, 11, 29, 53, 82, 129, 215, 389, 726, 1237, 2079, 3660, 6386, 11127, 19719, 34658, 60358, 105776, 185641, 324822, 569565, 999824, 1753763, 3075263, 5390839, 9452903, 16579307, 29065205, 50947822, 89330076, 156628094, 274559046, 481250343
Offset: 1

Views

Author

John Tyler Rascoe, Jul 17 2024

Keywords

Comments

These are integer compositions such that no adjacent parts are equal and their set of parts covers some interval.

Examples

			a(6) = 9 counts: (1,2,1,2), (2,1,2,1), (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1), (6).
		

Crossrefs

Programs

  • PARI
    Ca_x(s, N)={my(x='x+O('x^N), g=if(#s <1, 1, sum(i=1, #s, (Ca_x(s[^i], N) * x^(s[i])/(1+x^(s[i]))))/(1-sum(i=1, #s, (x^(s[i]))/(1+x^(s[i])))))); return(g)}
    B_x(N)={my(x='x+O('x^N), j=1, h=0); while((j*(j+1))/2 <= N, for(k=0,N, h += Ca_x([(1+k)..(j+k)], N+1)); j++); my(a = Vec(h)); vector(N, i, a[i])}
    B_x(20)

A374727 Number of n-color complete compositions of n.

Original entry on oeis.org

1, 1, 1, 1, 7, 13, 45, 91, 233, 477, 1079, 2205, 4709, 10299, 22393, 52005, 125055, 310373, 799677, 2096699, 5556681, 14806685, 39417431, 104570549, 276027337, 724183555, 1887993925, 4891368373, 12595644523, 32252683453, 82146468813, 208225916203, 525472131209
Offset: 1

Views

Author

John Tyler Rascoe, Jul 17 2024

Keywords

Comments

These are integer compositions whose set of parts covers an initial interval and contains k colors of each part k.

Examples

			a(6) = 13 counts: (1,1,1,1,1,1) and the 12 permutations of parts 1, 1, 2_a, and 2_b.
		

Crossrefs

Programs

  • PARI
    colr(x,y)={my(r=y-x+1, v=[x..y], z = vector(r*(r+(1+(x-1)*2))/2), k=1); for(i=1,#v,for(j=1,v[i],z[k]=v[i]; k++)); return(z)}
    C_x(s,N)={my(x='x+O('x^N), g=if(#s <1,1, sum(i=1,#s, C_x(s[^i],N) * x^(s[i]) )/(1-sum(i=1,#s, x^(s[i]))))); return(g)}
    B_x(N)={my(x='x+O('x^N), j=1, h=0, s=colr(1,j)); while(vecsum(s) <= N, h += C_x(s,N+1); j++;s=colr(1,j)); my(a = Vec(h)); vector(N, i, a[i])}
    B_x(25)

A374728 Number of n-color gap-free compositions of n.

Original entry on oeis.org

1, 1, 1, 3, 7, 19, 45, 105, 239, 507, 1079, 2303, 4829, 10425, 23263, 53363, 127995, 318983, 816057, 2133241, 5640135, 14975051, 39772751, 105322879, 277547989, 727276225, 1894282195, 4903985955, 12621154315, 32302574959, 82248961437, 208426306113, 525884062427
Offset: 1

Views

Author

John Tyler Rascoe, Jul 17 2024

Keywords

Comments

These are integer compositions whose set of parts covers some interval and contains k colors of each part k.

Examples

			a(5) = 7 counts: (1,1,1,1,1), (1,2_a,2_b), (1,2_b,2_a), (2_a,1,2_b), (2_a,2_b,1), (2_b,1,2_a), (2_b,2_a,1).
		

Crossrefs

Programs

  • PARI
    colr(x,y)={my(r=y-x+1, v=[x..y], z = vector(r*(r+(1+(x-1)*2))/2), k=1); for(i=1,#v,for(j=1,v[i],z[k]=v[i]; k++)); return(z)}
    C_x(s,N)={my(x='x+O('x^N), g=if(#s <1,1, sum(i=1,#s, C_x(s[^i],N+1) * x^(s[i]) )/(1-sum(i=1,#s, x^(s[i]))))); return(g)}
    B_x(N)={my(x='x+O('x^N), h=0); for(u=1,N, my(j=0); while(vecsum(colr(u,u+j)) <= N, h += C_x(colr(u,u+j),N+1); j++)); my(a = Vec(h)); vector(N, i, a[i])}
    B_x(20)

A379836 Number of pairs of adjacent equal parts in all complete compositions of n.

Original entry on oeis.org

0, 0, 1, 2, 5, 12, 23, 54, 118, 258, 550, 1178, 2540, 5394, 11473, 24174, 51021, 107210, 225099, 471322, 985202, 2055542, 4281847, 8906676, 18500425, 38379246, 79516158, 164561560, 340179441, 702506576, 1449311429, 2987297778, 6151964642, 12658841766, 26027603925
Offset: 0

Views

Author

John Tyler Rascoe, Jan 14 2025

Keywords

Comments

An integer composition is complete if its set of parts covers an initial interval.

Examples

			The complete compositions of n = 4 are: (1,1,2), (1,2,1), (2,1,1), and (1,1,1,1); having a total of 5 pairs of equal adjacent parts giving a(4) = 5.
		

Crossrefs

Programs

  • PARI
    C_xz(s,N) = {my(x='x+O('x^N), g=if(#s <1,1, sum(i=1,#s, C_xz(s[^i],N+1) * x^(s[i])/(1-(x^(s[i]))*(z-1)) )/(1-sum(i=1,#s, x^(s[i])/(1-(x^(s[i]))*(z-1)))))); return(g)}
    B_xz(N) = {my(x='x+O('x^N), j=1, h=0); while((j*(j+1))/2 <= N, h += C_xz(vector(j, i, i), N+1); j+=1); h}
    P_xz(N) = Pol(B_xz(N), {x})
    B_x(N) = {my(cx = deriv(P_xz(N),z), z=1); Vecrev(eval(cx))}
    B_x(20)

Formula

G.f.: B(x) = d/dz Sum_{k>0} C({1..k},x,z)|{z=1} where C({s},x,z) = Sum{i in {s}} ( C({s}-{i},x,z)*(x^i)/(1-(x^i)*(z-1)) )/(1 - Sum_{i in {s}} (x^i)/(1-(x^i)*(z-1))) with C({},x,z) = 1.

A380176 Number of pairs of adjacent equal parts in all gap-free compositions of n.

Original entry on oeis.org

0, 0, 1, 2, 6, 12, 26, 56, 124, 266, 563, 1204, 2573, 5468, 11559, 24370, 51281, 107720, 225867, 472660, 987378, 2059180, 4287932, 8916624, 18517398, 38406486, 79563118, 164636582, 340308519, 702713844, 1449664783, 2987870476, 6152930738, 12660419370, 26030245642
Offset: 0

Views

Author

John Tyler Rascoe, Jan 14 2025

Keywords

Comments

An integer composition is gap-free if its set of parts covers an interval.

Examples

			The gap-free compositions of n = 4 are: (4), (2,2), (1,1,2), (1,2,1), (2,1,1), and (1,1,1,1); having a total of 6 pairs of equal adjacent parts giving a(4) = 6.
		

Crossrefs

Programs

  • PARI
    C_xz(s,N) = {my(x='x+O('x^N), g=if(#s <1,1, sum(i=1,#s, C_xz(s[^i],N+1) * x^(s[i])/(1-(x^(s[i]))*(z-1)) )/(1-sum(i=1,#s, x^(s[i])/(1-(x^(s[i]))*(z-1)))))); return(g)}
    B_xz(N) = {my(x='x+O('x^N), j=1, h=0); while((j*(j+1))/2 <= N, for(k=0,N, h += C_xz([(1+k)..(j+k)], N+1)); j+=1); h}
    P_xz(N) = Pol(B_xz(N), {x})
    B_x(N) = {my(cx = deriv(P_xz(N),z), z=1); Vecrev(eval(cx))}
    B_x(20)

Formula

G.f.: B(x) = d/dz Sum_{j>0} Sum_{k>=j} C({j..k},x,z)|{z=1} where C({s},x,z) = Sum{i in {s}} ( C({s}-{i},x,z)*(x^i)/(1-(x^i)*(z-1)) )/(1 - Sum_{i in {s}} (x^i)/(1-(x^i)*(z-1))) with C({},x,z) = 1.
Showing 1-5 of 5 results.