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
KEYWORD
nonn,more
AUTHOR
Ilya Gutkovskiy, Dec 21 2024
EXTENSIONS
a(12)-a(24) from Michael S. Branicky, Dec 21 2024
STATUS
approved