Truncated sums for the partition function and a problem of Merca