# Consecutive integers that can be written as the product of three distinct primes

Mathematica novice here.

I want to start with a list of integers that are the product of three distinct primes m,n, and o, where 2 <= m|n|o < 2000.

Sort[Times @@@ Subsets[Select[Range[2000], PrimeQ], {3}]]


How do I find the longest subsequence within this list that consists of consecutive integers?

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Dr. belisarius Nov 6 '14 at 19:30
• Thanks - I should have included the follow up in the original question. How can I make it better at this point? – pgblu Nov 6 '14 at 19:31
• Your current question looks bad. The title refers to "consecutive integers" and the body to "consecutive primes". Please take your time to think your questions so you don't waste other peoples'. – Dr. belisarius Nov 6 '14 at 19:47
• Duly edited. Thank you. – pgblu Nov 6 '14 at 19:50

Select[Split[Sort[Times @@@ Subsets[Prime@Range@PrimePi@100, {3}]], #2 == #1 + 1 &],

• I recommend looking at those numbers which satisfy PrimeNu[#]==PrimeOmega[#]==3&. – Artes Nov 6 '14 at 19:57
• @Artes I don't get you. The OP wants to generate numbers in the range {8, ... ,1999^3}. Obviously you're not proposing to check that range, so I don't understand how you would apply your comment. – Dr. belisarius Nov 6 '14 at 23:58