Let the number of pounds of apples Ryan bought be x.
The cost of the apples is 1.29x.
The cost of the loaf of bread is $3.95.
The total cost is 1.29x + 3.95.
The total cost is also $10.40.
Therefore, 1.29x + 3.95 = 10.40.
Subtracting 3.95 from both sides of the equation gives 1.29x = 6.45.
Dividing both sides by 1.29 gives x = 5.
Thus, Ryan bought 5 pounds of apples. Answer: \boxed{5}.