If I have a list of rules associated with indexed variables like:
solution = {a[1] -> 1, a[2] -> 10, a[3] -> 100}
I would like to be able to extract all of the values associated with the rules. Although this problem is simple with a small number of variables, I am not sure how to generalize it.
For instance, I can use pattern matching to obtain 1 and 10, respectively:
a[1]/.solution
a[2]/.solution
However, I can't seem to generalize this to extract a[n] values from a list of rules. What is proper pattern to do this?