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 11-13 of 13 results.

A238439 Number of pairs (C,D) where C is a composition of u, D is a composition into distinct parts of v, and u + v = n.

Original entry on oeis.org

1, 2, 4, 10, 20, 42, 90, 182, 370, 748, 1526, 3060, 6156, 12344, 24748, 49654, 99392, 198966, 398166, 796658, 1593694, 3188584, 6377714, 12756888, 25515312, 51033092, 102068728, 204141754, 408292220, 816590586, 1633192578, 3266399030, 6532817194, 13065657556
Offset: 0

Views

Author

Joerg Arndt, Feb 27 2014

Keywords

Comments

This is one possible "overcomposition" analog of overpartitions (see A015128), as overpartitions are pairs of partitions and partitions into distinct parts.

Crossrefs

Cf. A236002.

Programs

  • Maple
    c:= proc(n) c(n):= ceil(2^(n-1)) end:
    b:= proc(n, i) b(n, i):= `if`(n=0, 1, `if`(i<1, 0,
        expand(b(n, i-1)+`if`(i>n, 0, x*b(n-i, i-1))))) end:
    d:= proc(n) d(n):= (p-> add(i!*coeff(p, x, i),
                i=0..degree(p)))(b(n$2)) end:
    a:= proc(n) a(n):= add(c(i)*d(n-i), i=0..n) end:
    seq(a(n), n=0..35);  # Alois P. Heinz, Feb 28 2014
  • Mathematica
    With[{N=66}, s=((1-q)*Sum[q^(n*(n+1)/2)*n!/QPochhammer[q, q, n], {n, 0, N}] )/(1-2*q)+O[q]^N; CoefficientList[s, q]] (* Jean-François Alcover, Jan 17 2016, adapted from PARI *)
  • PARI
    N=66;  q='q+O('q^N);
    gfc=(1-q)/(1-2*q); \\ A011782
    gfd=sum(n=0, N, n!*q^(n*(n+1)/2) / prod(k=1, n, 1-q^k ) ); \\ A032020
    Vec( gfc * gfd )

Formula

G.f.: C(x) * D(x) where C(x) and D(x) are respectively g.f. of A011782 and A032020.
a(n) ~ c * 2^n, where c = 1.521048571756660822618351147397515199378647451699288... . - Vaclav Kotesovec, Apr 13 2017

A355387 Number of ways to choose a distinct subsequence of an integer composition of n.

Original entry on oeis.org

1, 2, 5, 14, 37, 98, 259, 682, 1791, 4697, 12303, 32196, 84199, 220087, 575067, 1502176, 3923117, 10244069, 26746171, 69825070, 182276806, 475804961, 1241965456, 3241732629, 8461261457, 22084402087, 57640875725, 150442742575, 392652788250, 1024810764496
Offset: 0

Views

Author

Gus Wiseman, Jul 04 2022

Keywords

Comments

By "distinct" we mean equal subsequences are counted only once. For example, the pair (1,1)(1) is counted only once even though (1) is a subsequence of (1,1) in two ways. The version with multiplicity is A025192.

Examples

			The a(3) = 14 pairings of a composition with a chosen subsequence:
  (3)()     (3)(3)
  (21)()    (21)(1)   (21)(2)    (21)(21)
  (12)()    (12)(1)   (12)(2)    (12)(12)
  (111)()   (111)(1)  (111)(11)  (111)(111)
		

Crossrefs

For partitions we have A000712, composable A339006.
The homogeneous version is A011782, without containment A000302.
With multiplicity we have A025192, for partitions A070933.
The strict case is A032005.
The case of strict subsequences is A236002.
The composable case is A355384, homogeneous without containment A355388.
A075900 counts compositions of each part of a partition.
A304961 counts compositions of each part of a strict partition.
A307068 counts strict compositions of each part of a composition.
A336127 counts compositions of each part of a strict composition.

Programs

  • Mathematica
    Table[Sum[Length[Union[Subsets[y]]],{y,Join@@Permutations/@IntegerPartitions[n]}],{n,0,6}]
  • PARI
    lista(n)=my(f=sum(k=1,n,(x^k+x*O(x^n))/(1-x/(1-x)+x^k)));Vec((1-x)/((1-2*x)*(1-f))) \\ Christian Sievers, May 06 2025

Formula

G.f.: (1-x)/((1-2*x)*(1-f)) where f = Sum_{k>=1} x^k/(1-x/(1-x)+x^k) is the generating function for A331330. - Christian Sievers, May 06 2025

Extensions

a(16) and beyond from Christian Sievers, May 06 2025

A297120 Number of compositions derived from the overpartitions of n.

Original entry on oeis.org

1, 2, 5, 14, 36, 92, 234, 586, 1452, 3562, 8674, 20956, 50290, 119922, 284308, 670458, 1573250, 3674700, 8546282, 19796234, 45681908, 105041402, 240723618, 549919604, 1252492674, 2844551866, 6442833156, 14555300218, 32801922154, 73749649900, 165443000338
Offset: 0

Views

Author

Gregory L. Simay, Dec 25 2017

Keywords

Comments

Start by enumerating the overpartitions of n, then allow the parts to vary their arrangements.

Examples

			The A015128(4) = 14 overpartitions of 4 are: 4; 4'; 3,1; 3,1'; 3'1; 3',1', 2,2; 2',2; 2,1,1; 2,1',1; 2',1,1; 2',1',1; 1,1,1,1; and 1',1,1,1.  The corresponding 36 compositions are 4; 4'; 3,1; 1,3; 3,1'; 1',3; 3',1; 1,3'; 3',1'; 1',3'; 2,2; 2,2'; 2',2; 2,1,1; 1,2,1; 1,1,2; 2,1,1'; 2,1',1; 1,2,1'; 1,1',2'; 1',1,2; 1',2,1; 2',1,1; 1,2',2; 1,1,2'; 2',1,1'; 2',1',1; 1,2',1'; 1,1',2'; 1',2',1; 1',1,2'; 1,1,1,1; 1,1,1,1'; 1,1,1',1; 1,1',1,1; and 1',1,1,1. Note: For a sequence of like parts p,p,...p, an overcomposition of n will only recognize p,p...p and p',p...,p; the p' is not allowed to be other than the initial p term.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0 or i=1, (p+n)!*
          (1+n)/n!, add(b(n-i*j, i-1, p+j)*(1+j)/j!, j=0..n/i))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..35);  # Alois P. Heinz, Dec 26 2017
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n == 0 || i == 1, (p + n)!*(n + 1)/n!, Sum[b[n - i*j, i - 1, p + j]*(j + 1)/j!, {j, 0, n/i}]];
    a[n_] := b[n, n, 0];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Dec 27 2017, after Alois P. Heinz *)
  • PARI
    {my(n=30); apply(p->subst(serlaplace(p), y, 1), Vec(prod(k=1, n, (1+y*x^k)*exp(y*x^k + O(x*x^n)))))} \\ Andrew Howroyd, Dec 26 2017
    
  • Python
    from sympy.core.cache import cacheit
    from sympy import factorial
    @cacheit
    def b(n, i, p):  return factorial(p + n)*(n + 1)//factorial(n) if n==0 or i==1 else sum(b(n - i*j, i - 1, p + j)*(j + 1)//factorial(j) for j in range(n//i + 1))
    def a(n): return b(n, n, 0)
    print([a(n) for n in range(41)]) # Indranil Ghosh, Dec 29 2017, after Maple code

Extensions

More terms from Alois P. Heinz, Dec 26 2017
Previous Showing 11-13 of 13 results.