Explanation:
when we look at the picture and the presented patterns, we see that with every new black dot we introduce 3 new white dots.
only the first one is different, as we get 4 (= 3 + 1) white dots there.
so,
n is the number of black dots.
and W(n) is
W(n) = 3n + 1
whenever n is increased by 1, 3n increases then naturally by 3 (as we observed as behavior above).
and the "+ 1" white dot that was brought in additionally with the first black dot is represented by the "+ 1" ending of the equation. it is maintained for any number of black dots.