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

A330773 Number of perfect compositions of n.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 1, 11, 3, 5, 1, 27, 1, 5, 5, 49, 1, 27, 1, 27, 5, 5, 1, 163, 3, 5, 11, 27, 1, 49, 1, 261, 5, 5, 5, 231, 1, 5, 5, 163, 1, 49, 1, 27, 27, 5, 1, 1109, 3, 27, 5, 27, 1, 163, 5, 163, 5, 5, 1, 435, 1, 5, 27, 1631, 5, 49, 1, 27, 5, 49, 1, 2055, 1, 5, 27, 27, 5, 49, 1
Offset: 0

Views

Author

Augustine O. Munagi, Dec 30 2019

Keywords

Comments

A perfect composition of n is one whose sequence of parts contains one composition of every positive integer less than n.

Examples

			a(7) = 11 because the perfect compositions are 1111111, 1222, 2221, 1114, 4111, 124, 142, 214, 241, 412, 421.
For example, 241 generates the compositions of 1,...,6: 1,2,21,4,41,24.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; expand(x*(1+add(b(n/d),
           d=numtheory[divisors](n) minus {1, n})))
        end:
    a:= n-> (p-> add(coeff(p, x, i)*i!, i=1..degree(p)))(b(n+1)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jan 15 2020
  • Mathematica
    b[n_] := b[n] = x(1+Sum[b[n/d], {d, Divisors[n]~Complement~{1, n}}]);
    a[n_] := With[{p = b[n+1]}, Sum[Coefficient[p, x, i] i!, {i, Exponent[p, x]}]];
    a /@ Range[0, 100] (* Jean-François Alcover, Nov 17 2020, after Alois P. Heinz *)

Formula

a(1)=1, a(n) = Sum_{k=1..Omega(n+1)} k! * A251683(n+1,k), n>1.

A374925 Number of n-color compositions of n having at least one pair of adjacent parts that are the same color.

Original entry on oeis.org

0, 0, 1, 3, 10, 31, 91, 259, 726, 2007, 5489, 14888, 40122, 107574, 287239, 764405, 2028679, 5371858, 14198008, 37467982, 98749767, 259984452, 683865318, 1797500121, 4721662597, 12396308875, 32531025970, 85337831350, 223794544179, 586736215856, 1537941527011
Offset: 0

Views

Author

John Tyler Rascoe, Jul 24 2024

Keywords

Examples

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

Crossrefs

Programs

  • PARI
    C_x(N) = {my(x='x+O('x^N), h=(sum(i=1,N,(x^(2*i))/((1-x)*(1-x+x^i)*(1-sum(j=1,N, (x^j)/(1-x+x^j))))))/(1-sum(i=1,N,(x^i)/(1-x)))); concat([0,0],Vec(h))}
    C_x(40)

Formula

G.f.: Sum_{i>0} ( x^(2*i)/((1 - x)*(1 - x + x^i)*(1 - Sum_{j>0} ((x^j)/(1 - x + x^j)))) )/( 1 - Sum_{k>0} ((x^k)/(1 - x)) ).
a(n) = A088305(n) - A242551(n).
Showing 1-2 of 2 results.