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.

This page as a plain text file.
%I A379335 #12 Dec 23 2024 02:15:51
%S A379335 1,2,4,8,16,48,96,192,384,768,1536,5632,11264,22528,77312,154624,
%T A379335 309248,922624,1845248,6848512,17096576,34193152,68386304,272849152
%N A379335 Number of subsets of {-n..n} whose sum of reciprocals is 1.
%C A379335 Number of ways of writing 1 as Sum_{k=-n..n, k<>0} e(k)/k, where e(k) is 0 or 1.
%F A379335 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
%e A379335 a(3) = 4 subsets: {1}, {-3, 1, 3}, {-2, 1, 2}, {-3, -2, 1, 2, 3}.
%o A379335 (Python)
%o A379335 from functools import cache
%o A379335 from fractions import Fraction
%o A379335 @cache
%o A379335 def b(i, s):
%o A379335     if i == 0: return 1 if s == 1 else 0
%o A379335     return b(i-1, s) + b(i-1, s+Fraction(1, (-1)**(i&1)*((i+1)>>1)))
%o A379335 a = lambda n: b(2*n, 0)
%o A379335 print([a(n) for n in range(1, 11)]) # _Michael S. Branicky_, Dec 21 2024
%Y A379335 Cf. A092670.
%K A379335 nonn,more
%O A379335 1,2
%A A379335 _Ilya Gutkovskiy_, Dec 21 2024
%E A379335 a(12)-a(24) from _Michael S. Branicky_, Dec 21 2024