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 21-27 of 27 results.

A351983 Number of integer compositions of n with exactly one part above the diagonal.

Original entry on oeis.org

0, 0, 1, 2, 5, 9, 18, 35, 67, 131, 257, 505, 996, 1973, 3915, 7781, 15486, 30855, 61527, 122764, 245069, 489412, 977673, 1953515, 3904108, 7803545, 15599618, 31187269, 62355347, 124679883, 249310255, 498540890, 996953659, 1993701032, 3987069747, 7973603891
Offset: 0

Views

Author

Gus Wiseman, Apr 02 2022

Keywords

Examples

			The a(2) = 1 through a(6) = 18 compositions:
  (2)  (3)   (4)    (5)     (6)
       (21)  (13)   (14)    (15)
             (22)   (32)    (42)
             (31)   (41)    (51)
             (211)  (131)   (114)
                    (212)   (132)
                    (221)   (141)
                    (311)   (213)
                    (2111)  (222)
                            (312)
                            (321)
                            (411)
                            (1311)
                            (2112)
                            (2121)
                            (2211)
                            (3111)
                            (21111)
		

Crossrefs

The version for permutations is A000295, weak A057427.
The version for partitions is A002620, weak A001477.
The weak version is A177510.
The version for fixed points is A240736, nonfixed A352520.
This is column k = 1 of A352524; column k = 0 is A008930.
A238349 counts compositions by fixed points, first column A238351.
A352521 counts compositions by strong nonexcedances, first column A219282.
A352522 counts compositions by weak nonexcedances, first column A238874.
A352523 counts compositions by nonfixed points, first column A010054.
A352524 counts compositions by strong excedances, first column A008930.
A352525 counts compositions by weak excedances, first column A177510.

Programs

  • Mathematica
    pless[y_]:=Length[Select[Range[Length[y]],#
    				
  • PARI
    S(v,u,c=0)={vector(#v, k, c + sum(i=1, k-1, v[k-i]*u[i]))}
    seq(n)={my(v=vector(1+n), s=0); v[1]=1; for(i=1, n, v=S(v, vector(n, j, if(j>i,'x,1)), O(x^2)); s+=apply(p->polcoef(p,1), v)); s} \\ Andrew Howroyd, Jan 02 2023

Extensions

Terms a(21) and beyond from Andrew Howroyd, Jan 02 2023

A382991 Number of compositions of n such that any part 1 at position k can be k different colors.

Original entry on oeis.org

1, 1, 3, 10, 40, 193, 1110, 7473, 57821, 505945, 4940354, 53248874, 627848885, 8037734930, 111017325473, 1645384681765, 26044845197881, 438499277779636, 7824114643731522, 147476551001255125, 2928074880767254238, 61078483577649288463, 1335438738400978511877
Offset: 0

Views

Author

John Tyler Rascoe, Apr 11 2025

Keywords

Examples

			a(3) = 10 counts: (3), (2,1_a), (2,1_b), (1_a,2), (1_a,1_a,1_a), (1_a,1_a,1_b), (1_a,1_a,1_c), (1_a,1_b,1_a), (1_a,1_b,1_b), (1_a,1_b,1_c).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          add(b(n-j, i+1)*`if`(j=1, i, 1), j=1..n))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..22);  # Alois P. Heinz, Apr 23 2025
  • PARI
    A_x(N) = {my(x='x+O('x^N)); Vec(1+ sum(i=1,N, prod(j=1,i, j*x + x^2/(1-x))))}
    A_x(30)

Formula

G.f.: 1 + Sum_{i>0} Product_{j=1..i} ( j*x + x^2/(1-x) ).

A352875 Number of integer compositions y of n with a fixed point y(i) = i.

Original entry on oeis.org

0, 1, 1, 2, 5, 10, 21, 42, 86, 174, 351, 708, 1424, 2861, 5743, 11520, 23092, 46269, 92673, 185562, 371469, 743491, 1487870, 2977164, 5956616, 11916910, 23839736, 47688994, 95393322, 190811346, 381662507, 763389209, 1526881959, 3053930971, 6108131542, 12216698288
Offset: 0

Views

Author

Gus Wiseman, May 15 2022

Keywords

Examples

			The a(0) = 0 through a(5) = 10 compositions (empty column indicated by dot):
  .  (1)  (11)  (12)   (13)    (14)
                (111)  (22)    (32)
                       (112)   (113)
                       (121)   (122)
                       (1111)  (131)
                               (221)
                               (1112)
                               (1121)
                               (1211)
                               (11111)
		

Crossrefs

The version for partitions is A001522, ranked by A352827 (unproved).
The version for permutations is A002467, complement A000166.
The complement for partitions is A064428, ranked by A352826 (unproved).
This is the sum of latter columns of A238349, nonfixed A352523.
The complement is counted by A238351.
The complement for reversed partitions is A238394, ranked by A352830.
The version for reversed partitions is A238395, ranked by A352872.
The case of just one fixed point is A240736.
A008290 counts permutations by fixed points, nonfixed A098825.
A011782 counts compositions.
A115720 and A115994 count partitions by Durfee square.
A238352 counts reversed partitions by fixed points, rank statistic A352822.
A352512 counts fixed points in standard compositions, nonfixed A352513.
A352521 = comps by subdiags, first col A219282, rank stat A352514.
A352522 = comps by weak subdiags, first col A238874, rank stat A352515.
A352524 = comps by superdiags, first col A008930, rank stat A352516.
A352525 = comps by weak superdiags, col k=1 A177510, rank stat A352517.
A352833 counts partitions by fixed points.

Programs

  • Mathematica
    pq[y_]:=Length[Select[Range[Length[y]],#==y[[#]]&]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],pq[#]>0&]],{n,0,15}]
  • PARI
    S(v,u,c)={vector(#v, k, c + sum(i=1, k-1, v[k-i]*u[i]))}
    seq(n)={my(v=vector(1+n), s=vector(#v, i, 2^(i-2))); v[1]=1; s[1]=0; for(i=1, n, v=S(v, vector(n, j, if(j==i,'x,1)), O(x)); s-=apply(p->polcoef(p,0), v)); s} \\ Andrew Howroyd, Jan 02 2023

Formula

a(n) = 2^(n-1) - A238351(n) for n >= 1. - Andrew Howroyd, Jan 02 2023

Extensions

Terms a(21) and beyond from Andrew Howroyd, Jan 02 2023

A382992 Number of compositions of n that have at least 1 part equal to 1 and any part 1 at position k can be k different colors.

Original entry on oeis.org

0, 1, 2, 9, 38, 190, 1105, 7465, 57808, 505924, 4940320, 53248819, 627848796, 8037734786, 111017325240, 1645384681388, 26044845197271, 438499277778649, 7824114643729925, 147476551001252541, 2928074880767250057, 61078483577649281698, 1335438738400978500931
Offset: 0

Views

Author

John Tyler Rascoe, Apr 11 2025

Keywords

Examples

			a(3) = 9 counts: (2, 1_a), (2, 1_b), (1_a, 2), (1_a, 1_a, 1_a), (1_a, 1_a, 1_b), (1_a, 1_a, 1_c), (1_a, 1_b, 1_a), (1_a, 1_b, 1_b), (1_a, 1_b, 1_c).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, t, add(
          b(n-j, i+1, `if`(j=1, 1, t))*`if`(j=1, i, 1), j=1..n))
        end:
    a:= n-> b(n, 1, 0):
    seq(a(n), n=0..22);  # Alois P. Heinz, Apr 23 2025
  • PARI
    A_x(N) = {my(x='x+O('x^N)); Vec(-x^2/(1-x-x^2) + sum(i=1,N, prod(j=1,i, j*x + x^2/(1-x))))}
    A_x(30)

Formula

G.f.: -x^2/(1-x-x^2) + Sum_{i>0} Product_{j=1..i} ( j*x + x^2/(1-x) ).
a(n) = A382991(n) - A000045(n-1).

Extensions

Edited by Alois P. Heinz, Apr 23 2025

A338271 a(n) is the number of compositions of n, b_1 + ... + b_t = n such that sqrt(b_1 + sqrt(b_2 + ... + sqrt(b_t)...)) is an integer.

Original entry on oeis.org

1, 0, 0, 2, 0, 2, 0, 2, 2, 4, 2, 6, 2, 8, 4, 14, 6, 20, 8, 28, 14, 44, 20, 66, 30, 96, 46, 146, 70, 220, 102, 326, 154, 490, 232, 740, 346, 1102, 520, 1652, 782, 2484, 1166, 3716, 1750, 5568, 2628, 8358, 3936, 12518, 5900, 18760, 8848, 28138, 13256, 42170
Offset: 1

Views

Author

Peter Kagey, Oct 19 2020

Keywords

Comments

a(n) <= Sum_{k=1..floor(sqrt(n)/2)} A338286(floor((n-4*k^2)/2)) when n is even.
a(n) <= Sum_{k=1..floor((sqrt(n) - 1)/2)} A338286(floor((n-4*k^2-4*k-1)/2)) when n is odd and greater than 1.

Examples

			(Let s(k) = sqrt(k) for brevity.)
For n = 14, the a(14) = 8 valid compositions are:
14 = 2+2+2+2+2+3+1 and 2 = s(2+s(2+s(2+s(2+s(2+s(3+s(1)))))))
14 = 1+7+2+3+1     and 2 = s(1+s(7+s(2+s(3+s(1)))))
14 = 2+1+7+3+1     and 2 = s(2+s(1+s(7+s(3+s(1)))))
14 = 2+2+1+8+1     and 2 = s(2+s(2+s(1+s(8+s(1)))))
14 = 2+2+2+2+2+4   and 2 = s(2+s(2+s(2+s(2+s(2+s(4))))))
14 = 1+7+2+4       and 2 = s(1+s(7+s(2+s(4))))
14 = 2+1+7+4       and 2 = s(2+s(1+s(7+s(4))))
14 = 2+2+1+9       and 2 = s(2+s(2+s(1+s(9))))
		

Crossrefs

Formula

a(n) = Sum_{i=k..A000196(n)} A338268(n,k).

A383175 Number of compositions of n such that any fixed point k can be k different colors.

Original entry on oeis.org

1, 1, 2, 5, 10, 22, 48, 101, 213, 450, 945, 1961, 4064, 8385, 17242, 35332, 72141, 146924, 298552, 605377, 1225277, 2475912, 4995754, 10067848, 20267680, 40762951, 81916919, 164504411, 330155437, 662265817, 1327860471, 2661376529, 5332341881, 10680912173
Offset: 0

Views

Author

John Tyler Rascoe, Apr 18 2025

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(
         `if`(n<=i+j, ceil(2^(n-j-1)), b(n-j, i+1))*
         `if`(i=j, j, 1), j=1..n))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..33);  # Alois P. Heinz, Apr 18 2025
  • PARI
    A_x(N) = {my(x='x+O('x^N)); Vec(1+sum(i=1,N, prod(j=1,i, j*x^j-x^j+x/(1-x))))}
    A_x(30)

Formula

G.f.: 1 + Sum_{i>0} Product_{j=1..i} ( j*x^j - x^j + x/(1-x) ).

A238347 Triangle T(n,k) read by rows: T(n,k) is the number of compositions of n where the k-th part is the first occurrence of a smallest part, n>=1, 1<=k<=n.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 6, 2, 0, 0, 10, 5, 1, 0, 0, 20, 9, 3, 0, 0, 0, 37, 19, 7, 1, 0, 0, 0, 72, 36, 16, 4, 0, 0, 0, 0, 140, 71, 33, 11, 1, 0, 0, 0, 0, 275, 139, 67, 26, 5, 0, 0, 0, 0, 0, 540, 274, 135, 58, 16, 1, 0, 0, 0, 0, 0, 1069, 539, 269, 123, 42, 6, 0, 0, 0, 0, 0, 0, 2118, 1068, 534, 254, 99, 22, 1, 0
Offset: 1

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 25 2014

Keywords

Comments

Column k=0 is A238351. Column k=1 is A171682.
Row sums are A011782.

Examples

			Triangle starts:
01:  1,
02:  2, 0,
03:  3, 1, 0,
04:  6, 2, 0, 0,
05:  10, 5, 1, 0, 0,
06:  20, 9, 3, 0, 0, 0,
07:  37, 19, 7, 1, 0, 0, 0,
08:  72, 36, 16, 4, 0, 0, 0, 0,
09:  140, 71, 33, 11, 1, 0, 0, 0, 0,
10:  275, 139, 67, 26, 5, 0, 0, 0, 0, 0,
11:  540, 274, 135, 58, 16, 1, 0, 0, 0, 0, 0,
12:  1069, 539, 269, 123, 42, 6, 0, 0, 0, 0, 0, 0,
13:  2118, 1068, 534, 254, 99, 22, 1, 0, 0, 0, 0, 0, 0,
14:  4206, 2117, 1062, 516, 220, 64, 7, 0, 0, 0, 0, 0, 0, 0,
15:  8365, 4205, 2111, 1040, 470, 163, 29, 1, 0, 0, 0, 0, 0, 0, 0,
...
		
Previous Showing 21-27 of 27 results.