OFFSET
0,2
COMMENTS
a(n) is equal to the sum of the number of partitions of the set {1,1',2,2',...,n,n'} into disjoint nonempty subsets V1,...,Vk (1 <= k <= n) such that, for each 1 <= j <= k, if i is the least integer such that either i or i' belongs to Vj then {i,i'} is a subset of Vj (This matches A135920) and the total number of blocks (nonempty subsets V_j) across all such partitions (This matches A394822).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..335
FORMULA
PROG
(Python)
from functools import cache
@cache
def T(n, k):
if k == 1 or k == n: return 1
if k < 1 or k > n: return 0
if k % 2 == 0:
return 0 if n % 2 != 0 else (2 * T(n, k-1)) // k
else:
term1 = T(n-1, k) * (k + 1) // 2
if n % 2 == 0:
return term1
else:
term2 = T(n-1, k-2) * 2 // (k - 1)
return term1 + term2
def a(n):
if n == 0: return 1
return sum(T(2 * n, k) for k in range(1, 2 * n + 1))
print([a(n) for n in range(0, 22)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Husiev Andrii Alekseevich, Apr 10 2026
STATUS
approved
