OFFSET
0,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..100
EXAMPLE
a(1) = 10 ways: {}, {0}, {-1, 1} (2 permutations), {-1, 0, 1} (6 permutations).
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 23 2024
EXTENSIONS
a(9) and beyond from Michael S. Branicky, Dec 23 2024
STATUS
approved
