x is the first number so x+1 is the number just after it.
Adding them up gets to x+(x+1) = 2x+1. Set this equal to 345 and solve for x. See the attached image for the steps. The solution to the equation 2x+1 = 345 is x = 172 which means x+1 = 172+1 = 173.
Answer: The two page numbers are 172 and 173. Note how 172+173 = 345