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.

A326027 Number of nonempty subsets of {1..n} whose geometric mean is an integer.

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 9, 12, 19, 20, 21, 28, 29, 30, 31, 40, 41, 70, 71, 74, 75, 76, 77, 108, 123, 124, 211, 214, 215, 216, 217, 332, 333, 334, 335, 592, 593, 594, 595, 612, 613, 614, 615, 618, 639, 640, 641, 1160, 1183, 1324, 1325, 1328, 1329, 2176, 2177, 2196, 2197, 2198, 2199, 2414, 2415, 2416, 2443, 4000, 4001, 4002, 4003, 4006, 4007, 4008, 4009, 6626, 6627, 6628, 9753, 9756, 9757, 9758, 9759, 11136
Offset: 0

Views

Author

Gus Wiseman, Jul 14 2019

Keywords

Examples

			The a(1) = 1 through a(9) = 19 subsets:
  {1}  {1}  {1}  {1}      {1}      {1}      {1}      {1}      {1}
       {2}  {2}  {2}      {2}      {2}      {2}      {2}      {2}
            {3}  {3}      {3}      {3}      {3}      {3}      {3}
                 {4}      {4}      {4}      {4}      {4}      {4}
                 {1,4}    {5}      {5}      {5}      {5}      {5}
                 {1,2,4}  {1,4}    {6}      {6}      {6}      {6}
                          {1,2,4}  {1,4}    {7}      {7}      {7}
                                   {1,2,4}  {1,4}    {8}      {8}
                                            {1,2,4}  {1,4}    {9}
                                                     {2,8}    {1,4}
                                                     {1,2,4}  {1,9}
                                                     {2,4,8}  {2,8}
                                                              {4,9}
                                                              {1,2,4}
                                                              {1,3,9}
                                                              {2,4,8}
                                                              {3,8,9}
                                                              {4,6,9}
                                                              {3,6,8,9}
		

Crossrefs

First differences are A082553.
Partitions whose geometric mean is an integer are A067539.
Strict partitions whose geometric mean is an integer are A326625.
Subsets whose average is an integer are A051293.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],IntegerQ[GeometricMean[#]]&]],{n,0,10}]

Formula

a(n) = A357413(n) + A357414(n). For a squarefree n, a(n) = a(n-1) + 1. - Max Alekseyev, Mar 01 2025

Extensions

Terms a(57) onward from Max Alekseyev, Mar 01 2025

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

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.