%I #9 Nov 19 2024 00:53:04
%S 1,2,3,5,7,8,11,13,19,34,45,72,113,171,262,388,638,1128,1928,3370,
%T 5584,9691,17129,30493,54785,94510,169817,308491,559176,1019487,
%U 1816043,3333698,6153695,11384025,21100254,38262081,71096456,132675454,247900732,463959984
%N Number of subsets of the first n nonzero tetrahedral numbers whose sum is a nonzero tetrahedral number.
%H Michael S. Branicky, <a href="/A378170/b378170.txt">Table of n, a(n) for n = 1..103</a>
%e a(8) = 13 subsets: {1}, {4}, {10}, {20}, {35}, {56}, {84}, {120}, {1, 20, 35}, {1, 35, 84}, {10, 35, 120}, {1, 4, 10, 20} and {1, 4, 20, 56, 84}.
%o (Python)
%o from sympy import integer_nthroot
%o def is_tetra(n): return (c:=integer_nthroot(6*n, 3)[0])*(c+1)*(c+2) == 6*n
%o from functools import cache
%o @cache
%o def b(n, s):
%o if n == 0:
%o if s > 0 and is_tetra(s): return 1
%o return 0
%o return b(n-1, s) + b(n-1, s+n*(n+1)*(n+2)//6)
%o a = lambda n: b(n, 0)
%o print([a(n) for n in range(1, 30)]) # _Michael S. Branicky_, Nov 18 2024
%Y Cf. A000292, A377123, A378171.
%K nonn
%O 1,2
%A _Ilya Gutkovskiy_, Nov 18 2024
%E a(24) and beyond from _Michael S. Branicky_, Nov 18 2024