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.

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

A357414 Number of nonempty subsets of {1..n} whose elements have an even geometric mean.

Original entry on oeis.org

0, 0, 1, 1, 4, 4, 5, 5, 8, 12, 13, 13, 20, 20, 21, 21, 30, 30, 59, 59, 62, 62, 63, 63, 94, 104, 105, 187, 190, 190, 191, 191, 306, 306, 307, 307, 564, 564, 565, 565, 582, 582, 583, 583, 586, 600, 601, 601, 1120, 1134, 1275, 1275, 1278, 1278, 2125, 2125, 2144, 2144, 2145, 2145, 2360, 2360, 2361, 2381, 3938, 3938, 3939, 3939, 3942, 3942, 3943, 3943, 6560, 6560, 6561, 9663, 9666
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 27 2022

Keywords

Examples

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

Crossrefs

Programs

  • Python
    from functools import lru_cache
    from sympy import integer_nthroot
    def cond(p, c): r, b = integer_nthroot(p, c); return b and r&1 == 0
    @lru_cache(maxsize=None)
    def b(n, p, c):
        if n == 0: return int (c > 0 and cond(p, c))
        return b(n-1, p, c) + b(n-1, p*n, c+1)
    a = lambda n: b(n, 1, 0)
    print([a(n) for n in range(26)]) # Michael S. Branicky, Sep 29 2022

Formula

a(p) = a(p-1) for prime p > 2. - Michael S. Branicky, Sep 30 2022
a(n) = A326027(n) - A357413(n). - Max Alekseyev, Mar 06 2025

Extensions

a(24)-a(41) from Michael S. Branicky, Sep 30 2022
Terms a(42) onward from Max Alekseyev, Oct 11 2023
a(0) prepended by Max Alekseyev, Mar 06 2025

A357415 Number of nonempty subsets of {1..n} whose elements have an odd root mean square.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 6, 6, 7, 9, 16, 26, 41, 85, 142, 254, 461, 825, 1454, 2506, 4535, 7987, 14352, 26178, 47861, 87945, 162486, 304864, 565217, 1064529, 1992628, 3742934, 7034489, 13214869, 24924676, 46926388, 88812537, 167903969, 318619708, 604909434, 1150800393
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 27 2022

Keywords

Examples

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

Crossrefs

Formula

a(n) = A339454(n) - A357416(n).

Extensions

a(24)-a(41) from Alois P. Heinz, Sep 27 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
Showing 1-4 of 4 results.