login
A379335
Number of subsets of {-n..n} whose sum of reciprocals is 1.
1
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,2
COMMENTS
Number of ways of writing 1 as Sum_{k=-n..n, k<>0} e(k)/k, where e(k) is 0 or 1.
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
EXAMPLE
a(3) = 4 subsets: {1}, {-3, 1, 3}, {-2, 1, 2}, {-3, -2, 1, 2, 3}.
PROG
(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
CROSSREFS
Cf. A092670.
Sequence in context: A289671 A096853 A027155 * A129335 A264635 A046237
KEYWORD
nonn,more
AUTHOR
Ilya Gutkovskiy, Dec 21 2024
EXTENSIONS
a(12)-a(24) from Michael S. Branicky, Dec 21 2024
STATUS
approved