Given two natural numbers A and B where A + 1 < B, and a prime number P with P < A.
Is there a natural number X with A < X < B with prime factors p_i which are all p_i <= P?
Examples (table of prime factors):
A=15, B=17, P=2givesX=16=2^4A=100, B=109, P=7givesX=105=3*5*7orX=108=2^2*3^3A=216, B=225, P=5has no suchX
Naive solution: Enumerate all candidates X_c with A < X_c < B, and check their prime factors to be all less than / equal to P.
Is there a better way of finding an X (perhaps with some probability)? Or some way of saying whether there exist such an X? Or some probability of whether there exist such an X?