A379451 Number of ordered ways of writing 0 as Sum_{k=-n..n} e(k)*k, where e(k) is 0 or 1.
2, 10, 162, 6278, 430906, 46032666, 7029940154, 1453778429782, 390651831405906, 132345369222827306, 55150093300481888770, 27727437337790844360198, 16545310955942988999292586, 11561068480810074519638819626, 9349537740123803513263001013354, 8664632430514446774520557369434870
Offset: 0
Keywords
Examples
a(1) = 10 ways: {}, {0}, {-1, 1} (2 permutations), {-1, 0, 1} (6 permutations).
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..100
Programs
-
Python
from math import factorial from functools import cache @cache def b(i, s, c): if i == 0: return factorial(c) if s == 0 else 0 return b(i-1, s, c) + b(i-1, s+(i>>1)*(-1)**(i&1), c+1) def a(n): return b(2*n+1, 0, 0) print([a(n) for n in range(16)]) # Michael S. Branicky, Dec 23 2024
Extensions
a(9) and beyond from Michael S. Branicky, Dec 23 2024