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

A357413 Number of nonempty subsets of {1..n} whose elements have an odd geometric mean.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 4, 4, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 19, 19, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 39, 39, 40, 40, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 90, 90, 91, 91, 92, 92
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 27 2022

Keywords

Comments

The geometric mean of a subset such as in name must be an odd number in {1..n} which might ease the search for terms. - David A. Corneth, Sep 29 2022

Examples

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

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
    @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) if n&1 else b(n-1, p, c)
    @lru_cache(maxsize=None)
    def a(n): return b(n, 1, 0) if n&1 else b(n-1, 1, 0) if n else 0
    print([a(n) for n in range(41)]) # Michael S. Branicky, Sep 29 2022

Formula

a(2*n-1) = a(2*n) for n >= 1. - David A. Corneth, Sep 29 2022
a(n) = A326027(n) - A357414(n). - Max Alekseyev, Mar 01 2025

Extensions

a(24)-a(34) from Michael S. Branicky, Sep 29 2022
a(35)-a(70) from David A. Corneth, Sep 29 2022
a(0) prepended and terms a(71) onward added by Max Alekseyev, Mar 06 2025

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

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 4, 8, 11, 13, 26, 46, 81, 169, 284, 482, 857, 1461, 2548, 4370, 7917, 14181, 25648, 47330, 87457, 163291, 302678, 568974, 1064393, 1993805, 3742588, 7030646, 13231519, 24871349, 46994382, 88657700, 167876827, 318263561, 604694212, 1150634498
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 27 2022

Keywords

Examples

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

Crossrefs

Formula

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

Extensions

a(24)-a(41) from Alois P. Heinz, Sep 27 2022

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
Showing 1-4 of 4 results.