A327793 The number of nonnegative numbers that can be partitioned into a triangular number (A000217), a square number (A000290), and a pentagonal number (A000326) in n different ways.
1, 2, 10, 12, 13, 10, 23, 25, 16, 36, 31, 34, 27, 45, 36, 50, 68, 61, 53, 68, 57, 72, 60, 59, 61, 87, 85, 88, 82, 97, 91, 106, 95, 98, 127, 93, 111, 125, 127, 124, 109, 127, 152, 122, 114, 146, 147, 132, 157, 169, 118, 180, 156, 158, 163, 168, 180, 178, 190, 184, 187, 196, 207, 191, 210, 204, 207, 206, 190, 227, 231, 203, 195, 219, 264
Offset: 1
Keywords
Examples
a(0) does not exist since all numbers can be represented as the sum of a triangular, square and pentagonal number; a(1) = 1 because A240088({0}) = 1; a(2) = 2 because A240088({3, 18}) = 2; a(3) = 10 because A240088({1, 2, 4, 8, 9, 13, 14, 35, 98, 168}) = 3; a(4) = 12 because A240088({5, 6, 7, 21, 25, 30, 34, 39, 43, 48, 63, 78}) = 4; a(5) = 13 because A240088({10, 11, 12, 17, 20, 23, 28, 33, 69, 193, 203, 230, 243}) = 5; a(6) = 10 because A240088({19, 24, 32, 44, 53, 55, 74, 90, 111, 130}) = 6; a(7) = 23 because A240088({15, 16, 27, 29, 40, 46, 56, 60, 62, 68, 73, 84, 85, 95, 108, 113, 123, 135, 139, 163, 165, 273, 553}) = 7; etc.
Programs
-
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];
Comments