A bookshop had twice as many pens as notebooks. After 26 notebooks were sold and the shop owner added another 26 pens, the number of pens became 4 times the number of notebooks. How many pens were there at first?

Let's start by using variables to represent the unknown quantities in the problem.

Let x be the initial number of notebooks.
Since the bookshop had twice as many pens as notebooks, the initial number of pens was 2x.

After 26 notebooks were sold, the number of notebooks became x - 26.
After adding 26 pens, the number of pens became 2x + 26.
And finally, after these changes, the number of pens became 4 times the number of notebooks:

2x + 26 = 4(x - 26)

Now we can solve for x:

2x + 26 = 4x - 104

130 = 2x

x = 65

So there were initially 65 notebooks and 2x = 130 pens.