A and B had an equal numbers of cupcakes at first. After B bought twice as many cupcakes as he had at first and A gave away 26 cupcakes, B had 6 times as many cupcakes as A. How many cupcakes did A have at first?

1 answer

a=b
b+2b = 6(a-26)

3b = 6(b-26)
3b = 6b - 156
b = 52

So, they both started out with 52 cupcakes.