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.

A181854 Triangle read by rows: Partial row sums of A181853(n,k).

Original entry on oeis.org

1, 1, 2, 1, 4, 6, 1, 7, 18, 24, 1, 11, 42, 76, 88, 1, 16, 97, 286, 468, 528, 1, 22, 163, 556, 1050, 1332, 1392, 1, 29, 317, 1697, 4942, 8682, 10716, 11136, 1, 37, 493, 3209, 11502, 24770, 36108, 41016, 41856
Offset: 0

Views

Author

Peter Luschny, Dec 06 2010

Keywords

Examples

			[0]   1
[1]   1    2
[2]   1    4     6
[3]   1    7    18    24
[4]   1   11    42    76     88
[5]   1   16    97   286    468    528
[6]   1   22   163   556   1050   1332   1392
		

Crossrefs

Programs

  • Maple
    with(combstruct):
    a181854_row := proc(n) local k,L,l,R,comb;
    R := NULL; L := 0;
    for k from 0 to n do
       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:
  • Mathematica
    t[, 0] = 1; t[n, k_] := Sum[LCM @@ c, {c, Subsets[Range[n], {k}]}]; row[n_] := Table[t[n, k], {k, 0, n}] // Accumulate; Table[row[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, Jul 30 2013 *)

A181851 Triangle read by rows: T(n,k) = Sum_{c in composition(n,k)} lcm(c).

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 8, 6, 1, 5, 20, 15, 8, 1, 6, 21, 50, 24, 10, 1, 7, 56, 66, 96, 35, 12, 1, 8, 60, 180, 160, 160, 48, 14, 1, 9, 96, 264, 432, 325, 244, 63, 16, 1, 10, 105, 510, 776, 892, 585, 350, 80, 18, 1, 11, 220, 567, 1704, 1835, 1668, 966, 480, 99, 20, 1
Offset: 1

Views

Author

Peter Luschny, Dec 07 2010

Keywords

Comments

Composition(n,k) is the set of the k-tuples of positive integers which sum to n (see A181842). Taking the example in A181842, T(6,2) = lcm(5,1) + lcm(4,2) + lcm(3,3) + lcm(2,4) + lcm(1,5) = 5+4+3+4+5 = 21.

Examples

			[1]   1
[2]   2    1
[3]   3    4    1
[4]   4    8    6    1
[5]   5   20   15    8    1
[6]   6   21   50   24   10    1
[7]   7   56   66   96   35   12   1
		

Crossrefs

T(2n,n) gives A373865.

Programs

  • Maple
    with(combstruct):
    a181851_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 + ilcm(op(l));
       od;
       R := R,L;
    od;
    R end:
  • Mathematica
    c[n_, k_] := Permutations /@ IntegerPartitions[n, {k}] // Flatten[#, 1]&; t[n_, k_] := Total[LCM @@@ c[n, k]]; Table[t[n, k], {n, 1, 11}, {k, 1, n}] // Flatten (* Jean-François Alcover, Feb 05 2014 *)

A094308 Row sums of A094307.

Original entry on oeis.org

1, 3, 11, 34, 182, 282, 2034, 4908, 15564, 20100, 223620, 251340, 3295140, 3964380, 4324740, 9370200, 160014120, 180434520, 3440508120, 3673300680, 3906093240, 4350515400, 100294646760, 105648875640, 533598607080, 585081577080
Offset: 1

Views

Author

Amarnath Murthy, Apr 29 2004

Keywords

Crossrefs

Lower diagonal of A181853. - Alois P. Heinz, Jul 29 2013

Programs

  • Maple
    A094307 := proc(n,k) local a,i ; if n = 1 then RETURN(1) ; elif k > 1 and k < n then a := [seq(i,i=1..k-1),seq(i,i=k+1..n)] ; elif k = n then a := [seq(i,i=1..k-1)] ; else a := [seq(i,i=2..n)] ; fi ; ilcm(op(a)) ; end: A094308 := proc(n) local k ; add( A094307(n,k),k=1..n) ; end: for n from 1 to 40 do printf("%d, ",A094308(n)) ; od ; # R. J. Mathar, Apr 30 2007
  • Mathematica
    T[n_, k_] := LCM @@ Which[n == 1, {1}, 1 < k < n, Join[Range[k - 1], Range[k + 1, n]], k == n, Range[k - 1], True, Range[2, n]];
    a[n_] := Sum[T[n, k], {k, 1, n}];
    Array[a, 30] (* Jean-François Alcover, May 20 2020 *)
  • PARI
    T(n, k) = lcm(setminus(vector(n, i, i), Set(k))); \\ A094307
    a(n) = sum(k=1, n, T(n,k)); \\ Michel Marcus, May 20 2020

Formula

a(n) = A003418(n) * (n - Sum_{frac(log_p(n)) < log_p(2)} (1 - 1/p)). - Charlie Neder, Jun 13 2019

Extensions

More terms from R. J. Mathar, Apr 30 2007

A226037 a(n) = Sum_{c in P(n)} lcm(c) where P(n) is the set of all subsets of {1,2,...,n}.

Original entry on oeis.org

1, 2, 6, 24, 88, 528, 1392, 11136, 41856, 192192, 516032, 6192384, 13270272, 185783808, 511526400, 1163742720, 4403449344, 79262088192, 199280729088, 3985614581760, 8463108648960, 19276630732800, 54618972549120, 1310855341178880, 2751134770298880, 17228042511482880
Offset: 0

Views

Author

Peter Luschny, Jul 30 2013

Keywords

Examples

			a(4) = lcm{} + lcm{1} + lcm{2} + lcm{3} + lcm{4} + lcm{1,2} + lcm{1,3} + lcm{1,4} + lcm{2,3} + lcm{2,4} + lcm{3,4} + lcm{1,2,3} + lcm{1,2,4} + lcm{1,3,4} + lcm{2,3,4} + lcm{1,2,3,4} =
  1 + 1 + 2 + 3 + 4 + 2 + 3 + 4 + 6 + 4 + 12 + 6 + 4 + 12 + 12 + 12 = 88.
		

Crossrefs

Row sums of triangle A181853.

Programs

  • Maple
    with(combstruct):
    A226037 := proc(n) local R, c; R := 0; c := iterstructs(Combination(n)):
    while not finished(c) do R := R + ilcm(op(nextstruct(c))) od; R end: seq(A226037(n), n=0..25);
    # second Maple program:
    b:= proc(n, m) option remember; `if`(n=0, m,
          b(n-1, ilcm(m, n))+b(n-1, m))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..25);  # Alois P. Heinz, Sep 05 2023
  • Mathematica
    a[n_] := Total[LCM @@@ Rest[Subsets[Range[n]]]] + 1; Table[Print[an = a[n]]; an, {n, 0, 25}] (* Jean-François Alcover, Jan 15 2014 *)
  • Sage
    # (After Alois P. Heinz)
    @CachedFunction
    def C(n, k):
        if k == 0: return [1]
        w = C(n-1, k) if k < n else [0]
        return w + [lcm(c,n) for c in C(n-1, k-1)]
    def A226037(n): return add(add(C(n, k)) for k in (0..n))
    [A226037(n) for n in (0..20)]

Formula

a(n) = Sum_{k=0..n} Sum_{c in binomial(n,k)} lcm(c) where C(n,k) are the combinations of n with size k.
Showing 1-4 of 4 results.