Is there a function for the number of integers below n having only prime factors greater than or equal to p? For example, how do i determine the number of integers below 1000 only having prime factors greater than or equal to 7?

The only approach I can think of is:

1000/7 - 1000/(2*7)- 1000/(2*3*7) - 1000/(2*3*5*7)

Which can be re-expressed as:

1000/7 * (1 - 1/2 - 1/2*3 - 1/2*3*5) = 42 (which is incorrect).