# Coefficients obtained from ratio with partition number generating function

This is a question inspired by T. Amdeberhan's recent question, as well as another previos MO question.

For an integer partition $$\lambda$$, and $$k\in \mathbb{N}\cup\{\infty\}$$, let $$|\lambda|_k$$ denote the sum of the parts of $$\lambda$$, but where we only count each number at most $$k$$ times. E.g., $$|\lambda|_1$$ is the sum of the parts of $$\lambda$$ after removing repeated parts, and $$|\lambda|_{\infty}=|\lambda|$$ is the usual size of the partition.

Define the coefficients $$a_k(n)$$ by $$\frac{\sum_{\lambda} |\lambda|_k \cdot q^{|\lambda|}}{\sum_{\lambda} q^{|\lambda|}} = \left( \sum_{\lambda} |\lambda|_k \cdot q^{\lambda} \right) \cdot \prod_{i=1}^{n} (1-q^i) = \sum_{n\geq 0} a_k(n) q^{n}.$$

From the above-linked questions, we see that $$a_1(n) = n$$, while $$a_{\infty}(n) = \sigma(n) = \sum_{d\mid n} d$$, the sum of divisors of $$n$$. So $$a_k(n)$$ give a sequence of numbers which "interpolate" between $$n$$ and $$\sigma(n)$$ in some sense.

Question: What are these $$a_k(n)$$ for arbitrary $$k$$? Do they have any nice expression in general?

The bijection described by Mark Wildon in the second linked question can be adapted to your generalization. Indeed, $$|\lambda|_k$$ counts the number of ways of selecting a box $$B$$ of $$\lambda$$ such that, if the row containing $$B$$ has length $$m$$, then there are at most $$k-1$$ other rows of length $$m$$ above it. By erasing the rows of length $$m$$ that contain box $$B$$ or are above the row that contains $$B$$, we obtain the partition $$\mu$$. Let $$1\le c\le m$$ be the column containing $$B$$. Then for each $$m$$ we have a bijection $$(\lambda, B)\leftrightarrow (\mu, c)$$. Which gives $$\sum_{\lambda \vdash n}|\lambda|_k=\sum_{m=1}^n\sum_{r=1}^k p(n-rm)m$$ With a little calculation we see that this statement is equivalent to $$a_k(n)=n\left(\sum_{d\le k \,\text{and}\, d|n}\frac{1}{d}\right).$$ In this form, it is easier to see how $$a_k(n)$$ interpolates between $$n$$ and $$\sigma(n)$$.