A357352 Number of partitions of n into distinct positive triangular numbers such that the number of parts is a triangular number.
1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 1, 0, 1, 0, 2, 0, 1, 1, 0, 1, 1, 1, 0, 3, 0, 1, 1, 2, 0, 1, 1, 1, 3, 0, 2, 1, 1, 1, 1, 2, 2, 2, 1, 0, 3, 1, 0, 4, 1, 2, 2, 2, 1, 2, 2, 1, 3, 1, 3, 2, 1, 3, 3, 1, 2, 3, 3, 2, 2, 3, 1, 3, 3, 2, 4, 2, 2, 6, 2, 4, 2, 4
Offset: 0
Keywords
Examples
a(56) = 2 because we have [45,10,1] and [21,15,10,6,3,1].
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20000
Programs
-
Maple
b:= proc(n, i, t) option remember; (h-> `if`(n=0, `if`(issqr(8*t+1), 1, 0), `if`(n>i*(i+1)*(i+2)/6, 0, `if`(h>n, 0, b(n-h, i-1, t+1))+b(n, i-1, t))))(i*(i+1)/2) end: a:= n-> b(n, floor((sqrt(1+8*n)-1)/2), 0): seq(a(n), n=0..100); # Alois P. Heinz, Sep 25 2022
-
Mathematica
b[n_, i_, t_] := b[n, i, t] = With[{h = i(i+1)/2}, If[n == 0, If[IntegerQ@ Sqrt[8t+1], 1, 0], If[n > i(i+1)(i+2)/6, 0, If[h > n, 0, b[n-h, i-1, t+1]] + b[n, i-1, t]]]]; a[n_] := b[n, Floor[(Sqrt[8n+1]-1)/2], 0]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 22 2025, after Alois P. Heinz *)