functions – Is there a smart way of storing individual rating points

I was thinking about how to easily store the amount of certain constants i.e. store the values of a five point rating system for a histogram.

The way I am doing it at the moment is by writing down the quantity of each like,

But this seems too barbaric, so I am looking for a smarter way of doing this. Maybe in the form of a function that has the voting points as its coefficients. So it’s only required to store the value and by using a fixed key retrieve the points.

f(a_1, a_2, a_3, a_4, a_5) = x
f^-1(x)_k = (a_1, a_2, a_3, a_4, a_5)

Is there such a thing? What do I search for if there is? Or how do I create one?