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.
%I A342995 #21 Apr 04 2021 01:02:47 %S A342995 0,0,1,1,0,1,4,8,0,3,37,80,6,17,461,868,190,364,5570,11342,3993,7307, %T A342995 78644 %N A342995 Number of solutions to 1 +-/ 2 +-/ 3 +-/ ... +-/ n = 0. %C A342995 Normal operator precedence is followed, so division is performed before addition or subtraction. Unlike A058377, which uses only addition and subtraction, this sequence has solutions for all values of n >= 10. %e A342995 a(3) = 1 as 1 + 2 - 3 = 0 is the only solution. %e A342995 a(4) = 1 as 1 - 2 - 3 + 4 = 0 is the only solution. %e A342995 a(5) = 0, as in A058377. %e A342995 a(6) = 1 as 1 - 2 / 3 / 4 - 5 / 6 = 0 is the only solution. This is the first term where a solution exists while no corresponding solution exists in A058377. %e A342995 a(8) = 8. Seven of the solutions involve just addition and subtraction, matching those in A058377, but one additional solution exists using division: %e A342995 1 / 2 / 3 / 4 + 5 / 6 - 7 / 8 = 0. %e A342995 a(10) = 3. All three solutions require division: %e A342995 1 + 2 / 3 / 4 + 5 / 6 + 7 - 8 + 9 - 10 = 0, %e A342995 1 - 2 / 3 / 4 - 5 / 6 + 7 - 8 - 9 + 10 = 0, %e A342995 1 - 2 / 3 / 4 - 5 / 6 - 7 + 8 + 9 - 10 = 0. %e A342995 a(15) = 461. Of these, 361 use only addition and subtraction, the other 100 also require division. One example of the latter is %e A342995 1 / 2 / 3 / 4 - 5 - 6 - 7 / 8 + 9 / 10 + 11 + 12 - 13 + 14 / 15 = 0. %e A342995 a(20) = 11342. An example solution is %e A342995 1 / 2 / 3 - 4 / 5 / 6 + 7 / 8 / 9 + 10 + 11 / 12 - 13 + 14 / 15 / 16 %e A342995 + 17 / 18 + 19 / 20 = 0 %e A342995 which sums seven fractions that include eleven divisions. %t A342995 Table[Length@Select[Tuples[{"+","-","/"},k-1],ToExpression[""<>Riffle[ToString/@Range@k,#]]==0&],{k,11}] (* _Giorgos Kalogeropoulos_, Apr 02 2021 *) %o A342995 (Python) %o A342995 from itertools import product %o A342995 from fractions import Fraction %o A342995 def a(n): %o A342995 nn = ["Fraction("+str(i)+", 1)" for i in range(1, n+1)] %o A342995 return sum(eval("".join([*sum(zip(nn, ops+("",)), ())])) == 0 for ops in product("+-/", repeat=n-1)) %o A342995 print([a(n) for n in range(1, 11)]) # _Michael S. Branicky_, Apr 02 2021 %Y A342995 Cf. A342804 (using +-*/), A342602 (using +-*), A058377 (using +-), A063865, A000217, A025591, A161943. %K A342995 nonn,more %O A342995 1,7 %A A342995 _Scott R. Shannon_, Apr 01 2021