Let x = number of blue marbles
Then, 52-x = number of green marbles
Since the ratio of blue to green is 8:5, we can say that 8/5 = x/(52-x)
Cross multiply to get 8(52-x) = 5x
416 - 8x = 5x
416 = 13x
x = 32
There are 32 blue marbles and 20 green marbles.