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

A339454 Number of subsets of {1..n} whose root mean square is an integer.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 10, 15, 20, 29, 52, 87, 166, 311, 538, 943, 1682, 2915, 5054, 8905, 15904, 28533, 51826, 95191, 175402, 325777, 607542, 1134191, 2128922, 3986433, 7485522, 14065135, 26446388, 49796025, 93920770, 177470237, 335780796, 636883269, 1209603646
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 05 2020

Keywords

Examples

			a(9) = 15 subsets: {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {1, 7}, {1, 5, 7}, {1, 3, 5, 8, 9}, {3, 4, 5, 7, 9}, {1, 3, 5, 6, 8, 9} and {3, 4, 5, 6, 7, 9}.
		

Crossrefs

Programs

  • Python
    from functools import lru_cache
    from sympy.ntheory.primetest import is_square
    def cond(sos, c): return c > 0 and sos%c == 0 and is_square(sos//c)
    @lru_cache(maxsize=None)
    def b(n, sos, c):
        if n == 0: return int(cond(sos, c))
        return b(n-1, sos, c) + b(n-1, sos+n*n, c+1)
    a = lambda n: b(n, 0, 0)
    print([a(n) for n in range(1, 41)]) # Michael S. Branicky, Oct 06 2022

Formula

a(n) = A357415(n) + A357416(n). - Max Alekseyev, Mar 25 2025

Extensions

a(23)-a(40) from Alois P. Heinz, Dec 05 2020

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

A357411 Number of nonempty subsets of {1..n} whose elements have an odd harmonic mean.

Original entry on oeis.org

1, 1, 2, 2, 3, 5, 6, 6, 7, 9, 10, 10, 11, 13, 26, 26, 27, 45, 46, 74, 93, 99, 100, 162, 163, 165, 166, 458, 459, 865, 866, 866, 1647, 1669, 2724
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 27 2022

Keywords

Examples

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

Crossrefs

Programs

  • Python
    from fractions import Fraction
    from functools import lru_cache
    def cond(s, c): h = c/s; return h.denominator == 1 and h.numerator&1
    @lru_cache(maxsize=None)
    def b(n, s, c):
        if n == 0: return int (c > 0 and cond(s, c))
        return b(n-1, s, c) + b(n-1, s+Fraction(1, n), c+1)
    a = lambda n: b(n, 0, 0)
    print([a(n) for n in range(1, 18)]) # Michael S. Branicky, Sep 29 2022

Formula

a(p) = a(p-1) + 1 for prime p > 2. - Michael S. Branicky, Sep 30 2022

Extensions

a(24)-a(35) from Michael S. Branicky, Sep 30 2022

A357412 Number of nonempty subsets of {1..n} whose elements have an even harmonic mean.

Original entry on oeis.org

0, 1, 1, 2, 2, 7, 7, 8, 8, 9, 9, 16, 16, 17, 27, 28, 28, 55, 55, 106, 110, 111, 111, 216, 216, 217, 217, 634, 634, 1155, 1155, 1156, 2286, 2287, 3749
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 27 2022

Keywords

Examples

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

Crossrefs

Programs

  • Python
    from fractions import Fraction
    from functools import lru_cache
    def cond(s, c): h = c/s; return h.denominator == 1 and h.numerator&1 == 0
    @lru_cache(maxsize=None)
    def b(n, s, c):
        if n == 0: return int (c > 0 and cond(s, c))
        return b(n-1, s, c) + b(n-1, s+Fraction(1, n), c+1)
    a = lambda n: b(n, 0, 0)
    print([a(n) for n in range(1, 18)]) # Michael S. Branicky, Sep 29 2022

Formula

a(p) = a(p-1) for prime p > 2. - Michael S. Branicky, Sep 30 2022

Extensions

a(24)-a(35) from Michael S. Branicky, Sep 30 2022

A362802 a(n) is the number of ways in which the set of divisors of n can be partitioned into disjoint parts, all of length > 1 and with integer harmonic mean.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 15, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 175, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 188, 0
Offset: 1

Views

Author

Amiram Eldar, May 04 2023

Keywords

Examples

			 n  a(n)  partitions
==  ====  ==========
 6     1  {{1, 2, 3, 6}}
12     1  {{1, 2, 3, 6}, {4, 12}}
24     4  {{1, 2, 3, 6}, {4, 8, 12, 24}}, {{1, 2, 4, 8, 12, 24}, {3, 6}},
          {{1, 3, 6}, {2, 4, 8, 12, 24}}, {{1, 2, 3, 6}, {4, 12}, {8, 24}}
		

Crossrefs

Cf. A339453, A339665, A362801, A362803 (indices of records).

Programs

  • Mathematica
    harmQ[s_] := AllTrue[s, Length[#] > 1 && IntegerQ[HarmonicMean[#]] &]; a[n_] := Module[{d = Divisors[n], r}, r = ResourceFunction["SetPartitions"][d]; Count[r, _?harmQ]]; Array[a, 119]

Formula

a(A362801(n)) > 0.

A378844 Number of subsets of {1..n} whose arithmetic and harmonic means are both integers.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 14, 18, 19, 21, 27, 28, 29, 48, 49, 71, 75, 78, 79, 103, 104, 105, 106, 203, 204, 325, 326, 327, 530, 533, 795, 1198, 1199, 1204
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 09 2024

Keywords

Examples

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

Crossrefs

Programs

Formula

a(p^k) = a(p^k-1)+1 for p prime (see A339453). - Chai Wah Wu, Dec 12 2024

Extensions

a(25)-a(29) from Amiram Eldar, Dec 10 2024
a(30)-a(33) from Chai Wah Wu, Dec 12 2024
a(34)-a(38) from Chai Wah Wu, Dec 13 2024
Showing 1-6 of 6 results.