Hello,
I've been working on a project today regarding Deletable Numbers.
Basically the objective is that given an interval (say, [5000, 9000]), a sum of all the deletable numbers should be given.

I've written some code to determine all prime numbers within an interval (I made some tests and it calculated all primes within [1, 10000000] in 500ms), however even though I've been thinking about it all day, I have absolutely no idea on how to calculate which prime numbers are deletable.

Is there any algorithm for such an end? If not, any helpful ideas? =/

Thanks in advance.