I'm trying to solve the following problem, which is a twist on the change-making problem:
Given a set $S$ of coins, and a target value $b$, construct an algorithm to find all finite lists of coins satisfying the following properties:
The first $n$ coins in the list are smaller than $k$.
Each coin devalues, that is, the sum of coins is calculated like so: $$ C= \sum_{i = m}^{1} max(c_i - (l (m - i)), 0) $$ Where $m$ is the length of the list of coins and $l$ is the loss rate
$C = b$, that is, the list sums up to the target value.
To give an example, if the list of coins is $[0.5, 0.25, 0.25]$ and the loss rate $l$ is $0.15$, the sum of that list is $(0.5 - 0.15 * 2) + (0.25 - 0.15 * 1)+ (0.25- 0.15 * 0) = 0.55$.
Lists where some elements make no contribution (there are terms with $c_i - loss = 0$) should not be counted.
I need this algorithm for a real life problem, and after some attempts I couldn't crack it, so for now I'm using basically brute force to find some solutions.