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.

A379335 Number of subsets of {-n..n} whose sum of reciprocals is 1.

Original entry on oeis.org

1, 2, 4, 8, 16, 48, 96, 192, 384, 768, 1536, 5632, 11264, 22528, 77312, 154624, 309248, 922624, 1845248, 6848512, 17096576, 34193152, 68386304, 272849152
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 21 2024

Keywords

Comments

Number of ways of writing 1 as Sum_{k=-n..n, k<>0} e(k)/k, where e(k) is 0 or 1.

Examples

			a(3) = 4 subsets: {1}, {-3, 1, 3}, {-2, 1, 2}, {-3, -2, 1, 2, 3}.
		

Crossrefs

Cf. A092670.

Programs

  • Python
    from functools import cache
    from fractions import Fraction
    @cache
    def b(i, s):
        if i == 0: return 1 if s == 1 else 0
        return b(i-1, s) + b(i-1, s+Fraction(1, (-1)**(i&1)*((i+1)>>1)))
    a = lambda n: b(2*n, 0)
    print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Dec 21 2024

Formula

a(n) <= 2*a(n-1) since we count s and s union {-1/n, 1/n} for each subset s counted in a(n-1); equality holds for n prime (and other cases). - Michael S. Branicky, Dec 21 2024

Extensions

a(12)-a(24) from Michael S. Branicky, Dec 21 2024