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

A339665 Number of nonempty subsets of divisors of n whose harmonic mean is an integer.

Original entry on oeis.org

1, 2, 2, 3, 2, 9, 2, 4, 3, 4, 2, 17, 2, 4, 6, 5, 2, 19, 2, 10, 4, 4, 2, 37, 3, 4, 4, 12, 2, 45, 2, 6, 4, 4, 4, 57, 2, 4, 4, 28, 2, 29, 2, 6, 16, 4, 2, 85, 3, 6, 4, 6, 2, 35, 4, 23, 4, 4, 2, 301, 2, 4, 6, 7, 4, 28, 2, 6, 4, 19, 2, 255, 2, 4, 10, 6, 4, 20, 2, 61
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 11 2020

Keywords

Examples

			a(6) = 9 subsets: {1}, {2}, {3}, {6}, {2, 6}, {3, 6}, {1, 3, 6}, {2, 3, 6} and {1, 2, 3, 6}.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Count[Subsets[Divisors[n]], ?(Length[#] > 0 && IntegerQ[HarmonicMean[#]] &)]; Array[a, 100] (* _Amiram Eldar, Nov 09 2021 *)
  • PARI
    h(s, d) = #s/sum(k=1, #s, 1/d[s[k]]);
    a(n) = my(d=divisors(n), nb=0); forsubset(#d, s, if (#s && (denominator(h(s, d))==1), nb++)); nb; \\ Michel Marcus, Dec 15 2020
    
  • Python
    from itertools import combinations
    from sympy import divisors
    def A339665(n):
        ds = tuple(divisors(n, generator=True))
        return sum(sum(1 for d in combinations(ds,i) if n*i % sum(d) == 0) for i in range(1,len(ds)+1)) # Chai Wah Wu, Nov 09 2021

A339663 Number of nonempty subsets of divisors of n whose average is an integer.

Original entry on oeis.org

1, 2, 3, 4, 3, 9, 3, 7, 6, 6, 3, 24, 3, 7, 13, 12, 3, 27, 3, 22, 11, 7, 3, 72, 6, 6, 12, 21, 3, 83, 3, 20, 13, 6, 11, 133, 3, 7, 11, 70, 3, 82, 3, 21, 38, 7, 3, 230, 7, 14, 13, 23, 3, 88, 11, 65, 11, 6, 3, 763, 3, 7, 35, 36, 11, 84, 3, 22, 13, 73, 3, 780, 3, 6, 37, 20, 11, 82, 3, 228
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 11 2020

Keywords

Examples

			a(16) = 12 subsets: {1}, {2}, {4}, {8}, {16}, {2, 4}, {2, 8}, {2, 16}, {4, 8}, {4, 16}, {8, 16} and {1, 4, 16}.
		

Crossrefs

Programs

  • PARI
    sumbybits(v,b) = { my(s=0,i=1); while(b>0,s += (b%2)*v[i]; i++; b >>= 1); (s); };
    A339663(n) = { my(ds=divisors(n), u=#ds); sum(m=1, (2^u)-1, !(sumbybits(ds,m)%hammingweight(m))); }; \\ Antti Karttunen, Dec 12 2021

A339664 Number of nonempty subsets of divisors of n whose geometric mean is an integer.

Original entry on oeis.org

1, 2, 2, 5, 2, 4, 2, 8, 5, 4, 2, 10, 2, 4, 4, 15, 2, 10, 2, 10, 4, 4, 2, 16, 5, 4, 8, 10, 2, 8, 2, 26, 4, 4, 4, 63, 2, 4, 4, 16, 2, 8, 2, 10, 10, 4, 2, 30, 5, 10, 4, 10, 2, 16, 4, 16, 4, 4, 2, 20, 2, 4, 10, 45, 4, 8, 2, 10, 4, 8, 2, 196, 2, 4, 10, 10, 4, 8, 2, 30
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 11 2020

Keywords

Examples

			a(12) = 10 subsets: {1}, {2}, {3}, {4}, {6}, {12}, {1, 4}, {3, 12}, {1, 2, 4} and {3, 6, 12}.
		

Crossrefs

Showing 1-3 of 3 results.