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 A331843 #11 Apr 27 2020 05:55:13 %S A331843 1,1,0,1,2,0,1,2,0,2,7,2,0,2,6,1,4,6,2,12,24,3,8,0,8,32,6,2,13,26,6, %T A331843 34,36,0,32,150,3,20,50,14,54,126,32,32,12,55,160,78,122,44,174,4,72, %U A331843 294,36,201,896,128,62,180,176,164,198,852,110,320,159,212,414 %N A331843 Number of compositions (ordered partitions) of n into distinct triangular numbers. %H A331843 Alois P. Heinz, <a href="/A331843/b331843.txt">Table of n, a(n) for n = 0..20000</a> %H A331843 <a href="/index/Com#comp">Index entries for sequences related to compositions</a> %e A331843 a(10) = 7 because we have [10], [6, 3, 1], [6, 1, 3], [3, 6, 1], [3, 1, 6], [1, 6, 3] and [1, 3, 6]. %p A331843 h:= proc(n) option remember; `if`(n<1, 0, %p A331843 `if`(issqr(8*n+1), 1+h(n-1), h(n-1))) %p A331843 end: %p A331843 b:= proc(n, i, p) option remember; (t-> %p A331843 `if`(t*(i+2)/3<n, 0, `if`(n=0, p!, b(n, i-1, p)+ %p A331843 `if`(t>n, 0, b(n-t, i-1, p+1)))))((i*(i+1)/2)) %p A331843 end: %p A331843 a:= n-> b(n, h(n), 0): %p A331843 seq(a(n), n=0..73); # _Alois P. Heinz_, Jan 31 2020 %t A331843 h[n_] := h[n] = If[n<1, 0, If[IntegerQ @ Sqrt[8n+1], 1 + h[n-1], h[n-1]]]; %t A331843 b[n_, i_, p_] := b[n, i, p] = Function[t, If[t (i + 2)/3 < n, 0, If[n == 0, p!, b[n, i-1, p] + If[t>n, 0, b[n - t, i - 1, p + 1]]]]][(i(i + 1)/2)]; %t A331843 a[n_] := b[n, h[n], 0]; %t A331843 a /@ Range[0, 73] (* _Jean-François Alcover_, Apr 27 2020, after _Alois P. Heinz_ *) %Y A331843 Cf. A000217, A023361, A024940, A032020, A032021, A032022, A218396, A219107, A331844, A331845, A331846, A331847. %K A331843 nonn %O A331843 0,5 %A A331843 _Ilya Gutkovskiy_, Jan 29 2020