How to solve this problem 710 of Project-Euler
"when I use the above method to solve t(42), I am prompted that the memory is insufficient. How can I avoid memory overflow errors?"
ClearAll[twoPalCount]
twoPalCount = Total @*
Map[Multinomial @@ Floor[Values[Counts@#]/2] &] @*
Select[Not[FreeQ[2]@#] && Count[Tally[#][[All, 2]], _?OddQ] <= 1 &] @*
IntegerPartitions;
{#, twoPalCount@#} & /@ Range[42] // Grid
See: Number of palindromic permutations