OFFSET
1,2
COMMENTS
The largest nonnegative number k such that A240088(k) = n.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..200
EXAMPLE
a(0) does not exist since all numbers can be represented as the sum of a triangular, square & pentagonal number.
MATHEMATICA
f[n_] := Block[{j, k = 1, lenq, lenr, v = {}, t = PolygonalNumber[3, Range[0, 1 + Sqrt[2 n]]], s = PolygonalNumber[4, Range[0, 1 + Sqrt[n]]], p = PolygonalNumber[5, Range[0, 2 + Sqrt[2 n/3]]]}, u = Select[Union[Join[t, s, p]], # < n + 1 &]; q = IntegerPartitions[n, {3}, u]; lenq = 1 + Length@q; While[k < lenq, j = 1; r = q[[k]]; rr = Permutations@r; lenr = 1 + Length@rr; While[j < lenr, If[ MemberQ[t, rr[[j, 1]]] && MemberQ[s, rr[[j, 2]]] && MemberQ[p, rr[[j, 3]]], AppendTo[v, rr[[j]]]]; j++]; k++]; Length@v];
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Sep 25 2019
STATUS
approved