cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A378170 Number of subsets of the first n nonzero tetrahedral numbers whose sum is a nonzero tetrahedral number.

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