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.
%I A378961 #20 Apr 26 2025 05:31:34 %S A378961 1,1,2,1,3,5,5,11,19,33,55,92,192,327,579,1142,2052,3776,6936,12964, %T A378961 24308,44432,84763,159299,299093,567295,1075570,2045580,3883453, %U A378961 7411014,14164089,27044407,51759660,99259961,190371661,365537357,702901278,1352868238,2606296357 %N A378961 Number of sets of nonzero triangular numbers whose largest element is the n-th triangular number and whose sum is a triangular number. %H A378961 Robert Israel, <a href="/A378961/b378961.txt">Table of n, a(n) for n = 1..201</a> %e A378961 a(5) = 3 subsets of triangular numbers whose largest element is A000217(5)=15 and whose sum is in A000217: {15}, {6, 15} and {3, 10, 15}. %p A378961 istri:= proc(n) issqr(1+8*n) end proc: %p A378961 tri:= n -> n*(n+1)/2: %p A378961 F:= proc(n,s) option remember; local v; %p A378961 if s = 0 then return 1 fi; %p A378961 if s > n*(n+1)*(n+2)/6 then return 0 fi; %p A378961 v:= tri(n); %p A378961 if s >= v then procname(n-1,s-v) + procname(n-1,s) %p A378961 else procname(n-1,s) %p A378961 fi; %p A378961 end proc: %p A378961 f:= proc(n) local i,t,m; %p A378961 t:= 0; %p A378961 m:= n*(n+1)*(n+2)/6; %p A378961 for i from 1 while tri(i) <= m do %p A378961 t:= t + F(n,tri(i)) - F(n-1,tri(i)) %p A378961 od; %p A378961 t %p A378961 end proc: %p A378961 map(f, [$1..50]); # _Robert Israel_, Jan 13 2025 %Y A378961 Cf. A000217, A339612, A339613, A377123 (partial sums). %K A378961 nonn %O A378961 1,3 %A A378961 _Ilya Gutkovskiy_, Dec 12 2024