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

A244174 Number of compositions of 3n in which the minimal multiplicity of parts equals n.

Original entry on oeis.org

1, 3, 7, 21, 71, 253, 925, 3433, 12871, 48621, 184757, 705433, 2704157, 10400601, 40116601, 155117521, 601080391, 2333606221, 9075135301, 35345263801, 137846528821, 538257874441, 2104098963721, 8233430727601, 32247603683101, 126410606437753, 495918532948105
Offset: 0

Views

Author

Alois P. Heinz, Jun 21 2014

Keywords

Examples

			a(2) = 7: [1,1,2,2], [1,2,1,2], [1,2,2,1], [2,1,1,2], [2,1,2,1], [2,2,1,1], [3,3].
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<3, 2^(n+1)-1, ((15*n^2-31*n+12) *a(n-1)
           -2*(3*n-2)*(2*n-3) *a(n-2)) / ((3*n-5)*n))
        end:
    seq(a(n), n=0..30);
  • Mathematica
    a[n_] := a[n] = If[n < 3, 2^(n+1) - 1, ((15*n^2 - 31*n + 12)*a[n-1] - 2*(3*n - 2)*(2*n - 3)*a[n-2])/((3*n - 5)*n)]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Nov 07 2014, after Alois P. Heinz *)
  • Sage
    A244174 = lambda m: SetPartitions(2*m,[2*m]).cardinality()+2*SetPartitions(2*m,[m,m]).cardinality()
    [1] + [A244174(m) for m in (1..26)] # Peter Luschny, Aug 02 2015

Formula

a(n) = A242451(3n,n).
Recurrence: see Maple program.
For n>0, a(n) = 1 + C(2n,n) = 1 + A000984(n). - Vaclav Kotesovec, Jun 21 2014
G.f.: 1/(sqrt(1-4*x)) + x/(1-x). - Alois P. Heinz, Jun 22 2014
a(n) = A245732(2n,n). - Alois P. Heinz, Jul 30 2014
a(n) = A065567(2n,n) for n>=1. - Alois P. Heinz, Sep 05 2023

A181853 Triangle read by rows: T(n,k) = Sum_{c in C(n,k)} lcm(c) where C(n,k) is the set of all k-subsets of {1,2,...,n}.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 6, 11, 6, 1, 10, 31, 34, 12, 1, 15, 81, 189, 182, 60, 1, 21, 141, 393, 494, 282, 60, 1, 28, 288, 1380, 3245, 3740, 2034, 420, 1, 36, 456, 2716, 8293, 13268, 11338, 4908, 840, 1, 45, 726, 5578, 22207, 47351, 57598, 40602, 15564, 2520
Offset: 0

Views

Author

Peter Luschny, Dec 06 2010

Keywords

Comments

The C(n,k) are also called combinations of n with size k (see A181842).
Main diagonal gives: A003418. Lower diagonal gives: A094308. Column k=1 gives: A000217. - Alois P. Heinz, Jul 29 2013

Examples

			[0]   1
[1]   1    1
[2]   1    3     2
[3]   1    6    11     6
[4]   1   10    31    34    12
[5]   1   15    81   189   182    60
[6]   1   21   141   393   494   282   60
		

Crossrefs

Row sums give A226037.

Programs

  • Maple
    with(combstruct):
    a181853_row := proc(n) local k,L,l,R,comb;
    R := NULL;
    for k from 0 to n do
       L := 0;
       comb := iterstructs(Combination(n),size=k):
       while not finished(comb) do
          l := nextstruct(comb);
          L := L + ilcm(op(l));
       od;
       R := R,L;
    od;
    R end:
    # second Maple program:
    b:= proc(n, k) option remember; `if`(k=0, [1],
         [`if`(k add(c, c=b(n, k)):
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Jul 29 2013
    # third Maple program:
    b:= proc(n, m) option remember; expand(`if`(n=0, m,
          b(n-1, ilcm(m, n))*x+b(n-1, m)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 1)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Sep 05 2023
  • Mathematica
    t[, 0] = 1; t[n, k_] := Sum[LCM @@ c, {c, Subsets[Range[n], {k}]}]; Table[t[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 29 2013 *)
  • Sage
    # (After Alois P. Heinz)
    @CachedFunction
    def b(n, k):
        if k == 0: return [1]
        w = b(n-1, k) if kPeter Luschny, Jul 29 2013

A065568 Sum over all subsets of {1,..,n} of the GCD of the subset.

Original entry on oeis.org

1, 4, 10, 22, 42, 84, 154, 298, 568, 1108, 2142, 4254, 8362, 16636, 33076, 66004, 131556, 262974, 525136, 1050016, 2098756, 4196962, 8391288, 16782312, 33559612, 67118176, 134227594, 268453714, 536889198, 1073777718, 2147519572
Offset: 1

Views

Author

Wouter Meeussen, Nov 30 2001

Keywords

Crossrefs

Row sums of A065567, first differences equal A034738,

Programs

  • Mathematica
    Sum[Plus @@ GCD @@@ KSubsets[Range[n], m], {m, n}] (* or *)
    Table[Sum[Plus@@(EulerPhi[Divisors[k]] 2^(k/Divisors[k]))/2, {k, n}], {n, 42}]

A181847 Triangle read by rows: T(n,k)= Sum_{c in C(n,k)}gcd(c) where C(n,k) is the set of all k-tuples of positive integers whose elements sum to n.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 4, 3, 1, 5, 4, 6, 4, 1, 6, 9, 11, 10, 5, 1, 7, 6, 15, 20, 15, 6, 1, 8, 12, 24, 36, 35, 21, 7, 1, 9, 12, 30, 56, 70, 56, 28, 8, 1, 10, 17, 42, 88, 127, 126, 84, 36, 9, 1
Offset: 1

Views

Author

Peter Luschny, Dec 07 2010

Keywords

Comments

C(n,k) counted by A007318(n-1,k-1) are also called compositions of n of size k (see A181842).

Examples

			[1]   1
[2]   2   1
[3]   3   2    1
[4]   4   4    3    1
[5]   5   4    6    4    1
[6]   6   9   11   10    5   1
[7]   7   6   15   20   15   6   1
		

Crossrefs

Programs

  • Maple
    with(combstruct): # By generating the objects, very inefficient.
    a181847_row := proc(n) local k,L,l,R,comp; R := NULL;
    for k from 1 to n do
       L := 0;
       comp := iterstructs(Composition(n),size=k):
       while not finished(comp) do
          l := nextstruct(comp);
          L := L + igcd(op(l));
       od;
       R := R,L;
    od;
    R end:
    # second Maple program:
    with(numtheory):
    T := (n, k) -> add(phi(d)*binomial(n/d-1, k-1), d = divisors(n)):
    seq(seq(T(n, k), k=1..n), n=1..10); # Peter Luschny, Aug 27 2019
  • Sage
    # uses[DivisorTriangle from A327029]
    # DivisorTriangle Computes the (0,0)-based version.
    DivisorTriangle(euler_phi, lambda n,k: binomial(n-1, k-1), 10) # Peter Luschny, Aug 27 2019
Showing 1-4 of 4 results.