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.

A082550 Number of sets of distinct positive integers whose arithmetic mean is an integer, the largest integer of the set being n.

Original entry on oeis.org

1, 1, 3, 3, 7, 11, 19, 31, 59, 103, 187, 343, 631, 1171, 2191, 4095, 7711, 14571, 27595, 52431, 99879, 190651, 364723, 699071, 1342183, 2581111, 4971067, 9586983, 18512791, 35791471, 69273667, 134217727, 260301175, 505290271, 981706831, 1908874583, 3714566311
Offset: 1

Views

Author

Naohiro Nomoto, May 03 2003

Keywords

Comments

Equivalently, number of nonempty subsets of [n] the sum of whose elements is divisible by n. - Dimitri Papadopoulos, Jan 18 2016

Examples

			a(5) = 7: the seven sets are (1+2+3+4+5)/5 = 3, 5/1 = 5, (1+5)/2 = 3, (1+3+5)/3 = 3, (3+5)/2 = 4, (3+4+5)/3 = 4, (1+2+4+5)/4 = 3.
		

Crossrefs

Row sums of A267632.

Programs

  • Mathematica
    Table[Length[Select[Select[Subsets[Range[n]],Max[#]==n&], IntegerQ[ Mean[ #]]&]], {n,22}] (* Harvey P. Dale, Jul 23 2011 *)
    Table[Total[Table[Length[Select[Select[Subsets[Range[n]], Length[#] == k &],IntegerQ[Total[#]/n] &]], {k, n}]], {n, 10}] (* Dimitri Papadopoulos, Jan 18 2016 *)
  • PARI
    a(n) = sumdiv(n, d, (d%2)* 2^(n/d)*eulerphi(d))/n - 1; \\ Michel Marcus, Feb 10 2016
    
  • Python
    from sympy import totient, divisors
    def A082550(n): return (sum(totient(d)<>(~n&n-1).bit_length(),generator=True))<<1)//n-1 # Chai Wah Wu, Feb 22 2023

Formula

a(n) = A063776(n) - 1.
a(n) = A051293(n+1) - A051293(n). - Reinhard Zumkeller, Feb 19 2006
a(n) = A008965(n) for odd n. - Dimitri Papadopoulos, Jan 18 2016
G.f.: -x/(1 - x) - Sum_{m >= 0} (phi(2*m + 1)/(2*m + 1)) * log(1 - 2*x^(2*m + 1)). - Petros Hadjicostas, Jul 13 2019
a(n) = A309402(n,n). - Alois P. Heinz, Jul 28 2019

Extensions

a(22) from Harvey P. Dale, Jul 23 2011
a(23)-a(32) from Dimitri Papadopoulos, Jan 18 2016

A309280 T(n,k) is (1/k) times the sum of the elements of all subsets of [n] whose sum is divisible by k; triangle T(n,k), n >= 1, 1 <= k <= n*(n+1)/2, read by rows.

Original entry on oeis.org

1, 6, 1, 1, 24, 6, 4, 1, 1, 1, 80, 20, 9, 4, 4, 2, 2, 1, 1, 1, 240, 60, 30, 14, 12, 7, 5, 3, 3, 3, 2, 2, 1, 1, 1, 672, 168, 84, 42, 29, 20, 15, 10, 9, 7, 5, 5, 4, 4, 4, 3, 2, 2, 1, 1, 1, 1792, 448, 202, 112, 71, 49, 40, 27, 23, 17, 15, 12, 10, 10, 8, 8, 7, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1
Offset: 1

Views

Author

Alois P. Heinz, Jul 20 2019

Keywords

Comments

T(n,k) is defined for all n >= 0, k >= 1. The triangle contains only the positive terms. T(n,k) = 0 if k > n*(n+1)/2.
The sequence of column k satisfies a linear recurrence with constant coefficients of order 3*A000593(k).

Examples

			The subsets of [4] whose sum is divisible by 3 are: {}, {3}, {1,2}, {2,4}, {1,2,3}, {2,3,4}.  The sum of their elements is 0 + 3 + 3 + 6 + 6 + 9 = 27.  So T(4,3) = 27/3 = 9.
Triangle T(n,k) begins:
    1;
    6,  1,  1;
   24,  6,  4,  1,  1, 1;
   80, 20,  9,  4,  4, 2, 2, 1, 1, 1;
  240, 60, 30, 14, 12, 7, 5, 3, 3, 3, 2, 2, 1, 1, 1;
  ...
		

Crossrefs

Row sums give A309281.
Row lengths give A000217.
T(n,n) gives A309128.
Rows reversed converge to A000009.

Programs

  • Maple
    b:= proc(n, m, s) option remember; `if`(n=0, [`if`(s=0, 1, 0), 0],
          b(n-1, m, s) +(g-> g+[0, g[1]*n])(b(n-1, m, irem(s+n, m))))
        end:
    T:= (n, k)-> b(n, k, 0)[2]/k:
    seq(seq(T(n, k), k=1..n*(n+1)/2), n=1..10);
    # second Maple program:
    b:= proc(n, s) option remember; `if`(n=0, add(s/d *x^d,
          d=numtheory[divisors](s)), b(n-1, s)+b(n-1, s+n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n, 0)):
    seq(T(n), n=1..10);
  • Mathematica
    b[n_, m_, s_] := b[n, m, s] = If[n == 0, {If[s == 0, 1, 0], 0}, b[n-1, m, s] + Function[g, g + {0, g[[1]] n}][b[n-1, m, Mod[s+n, m]]]];
    T[n_, k_] := b[n, k, 0][[2]]/k;
    Table[T[n, k], {n, 1, 10}, {k, 1, n(n+1)/2}] // Flatten (* Jean-François Alcover, Oct 04 2019, after Alois P. Heinz *)

Formula

T(n+1,n*(n+1)/2+1) = A000009(n) for n >= 0.

A309281 Total sum of the sum of divisors of the element sum over all nonempty subsets of [n].

Original entry on oeis.org

1, 8, 37, 124, 384, 1088, 2888, 7480, 18764, 45852, 110266, 260935, 609153, 1407089, 3218496, 7298207, 16429096, 36739434, 81668800, 180586647, 397394871, 870673675, 1900033959, 4131237894, 8952390226, 19339847678, 41660216922, 89502201047, 191809609673
Offset: 1

Views

Author

Alois P. Heinz, Jul 20 2019

Keywords

Examples

			The nonempty subsets of [3] are {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}, having element sums 1, 2, 3, 3, 4, 5, 6 with sums of divisors 1, 3, 4, 4, 7, 6, 12, having sum 37.  So a(3) = 37.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m, s) option remember; `if`(n=0, [`if`(s=0, 1, 0), 0],
          b(n-1, m, s) +(g-> g+[0, g[1]*n])(b(n-1, m, irem(s+n, m))))
        end:
    a:= n-> add(b(n, k, 0)[2]/k, k=1..n*(n+1)/2):
    seq(a(n), n=1..22);
    # second Maple program:
    b:= proc(n, s) option remember; `if`(n=0,
          numtheory[sigma](s), b(n-1, s)+b(n-1, s+n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=1..30);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n==0, If[s==0, 0, DivisorSigma[1, s]], b[n-1, s] + b[n-1, s+n]];
    a[n_] := b[n, 0];
    Array[a, 30] (* Jean-François Alcover, Dec 20 2020, after 2nd Maple program *)

Formula

a(n) = Sum_{k=1..n*(n+1)/2} A309280(n,k).
a(n) = Sum_{k=1..2^n-1} sigma(A096137(n,k)).
a(n) = Sum_{k=1..n*(n+1)/2} sigma(k) * A053632(n,k).
a(n) = Sum_{k=1..n*(n+1)/2} k * A309402(n,k).
a(n) ~ Pi^2 * n^2 * 2^(n-3) / 3. - Vaclav Kotesovec, Aug 05 2019

A309403 Total sum of the number of divisors of the element sum over all nonempty subsets of [n].

Original entry on oeis.org

1, 5, 16, 40, 96, 217, 469, 1011, 2147, 4497, 9389, 19489, 40256, 82948, 170413, 349158, 714153, 1458199, 2972683, 6052561, 12308971, 25006177, 50755272, 102933086, 208594116, 422432018, 854956112, 1729360940, 3496259940, 7065053883, 14270420877, 28812580857
Offset: 1

Views

Author

Alois P. Heinz, Jul 28 2019

Keywords

Crossrefs

Row sums of A309402.

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0,
          numtheory[tau](s), b(n-1, s)+b(n-1, s+n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=1..30);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 0,
         If[s == 0, 0, DivisorSigma[0, s]], b[n-1, s] + b[n-1, s+n]];
    a[n_] := b[n, 0];
    Table[a[n], {n, 1, 30}] (* Jean-François Alcover, Mar 24 2022, after Alois P. Heinz *)
Showing 1-4 of 4 results.