Note that the limit will hold for any bounded monotonic integrable $f $, and any sequence satisfying the condition.
This holds for many other sequences which behave appropriately-primality or compositeness has little to do with it.