At the grocery store Ryan bought a loaf of bread and some apples. The loaf of bread cost $3.95 and the apples cost $1.29 per pound. If Ryan spent $10.40 for the loaf of bread and apples, how many pounds of apples did he buy?

Let the number of pounds of apples Ryan bought be x.

The total cost of the apples is 1.29x.
And the total cost of the loaf of bread is $3.95
So, the total cost of the loaf of bread and apples is 1.29x + 3.95.
Since the total amount Ryan spent is $10.40, then the equation is 1.29x + 3.95 = 10.40.
Subtracting 3.95 from both sides, we get 1.29x = 6.45.
Dividing both sides by 1.29, x = 5 pounds.
Hence, Ryan bought 5 pounds of apples. Answer: \boxed{5}.