One way to solve this is via setting different quantities, like pack of products as variants.
In your case, as the variant column, you can set “Pack”. And under the Pack column, you can set values like - 5 pack, 10 pack, 15 pack etc.
And for each pack you can set a different price.
Here your customer will have to choose one of these packs. But selecting a specific count of items like 6 or 9 items will not be possible in this approach.