A378170 Number of subsets of the first n nonzero tetrahedral numbers whose sum is a nonzero tetrahedral number.
1, 2, 3, 5, 7, 8, 11, 13, 19, 34, 45, 72, 113, 171, 262, 388, 638, 1128, 1928, 3370, 5584, 9691, 17129, 30493, 54785, 94510, 169817, 308491, 559176, 1019487, 1816043, 3333698, 6153695, 11384025, 21100254, 38262081, 71096456, 132675454, 247900732, 463959984
Offset: 1
Keywords
Examples
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}.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..103
Programs
-
Python
from sympy import integer_nthroot def is_tetra(n): return (c:=integer_nthroot(6*n, 3)[0])*(c+1)*(c+2) == 6*n from functools import cache @cache def b(n, s): if n == 0: if s > 0 and is_tetra(s): return 1 return 0 return b(n-1, s) + b(n-1, s+n*(n+1)*(n+2)//6) a = lambda n: b(n, 0) print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Nov 18 2024
Extensions
a(24) and beyond from Michael S. Branicky, Nov 18 2024