Least pair of numbers having at least $k$ distinct prime factors

191 Views Asked by At

Consecutive numbers with less than $k$ prime factors?

shows that for every $k$, there is a pair $(n/n+1)$, such that $n$ and $n+1$ both have at least $k$ distinct prime factors.

The object is to find the least such pair depending on $k$.

? for(k=2,6,n=1;while(1-(omega(n)>=k)*(omega(n+1)>=k),n=n+1);print(k,"   ",n,"
  ",n+1,"    ",factor(n),"     ",factor(n+1)))

2   14   15    [2, 1; 7, 1]     [3, 1; 5, 1]
3   230   231    [2, 1; 5, 1; 23, 1]     [3, 1; 7, 1; 11, 1]
4   7314   7315    [2, 1; 3, 1; 23, 1; 53, 1]     [5, 1; 7, 1; 11, 1; 19, 1]
5   254540   254541    [2, 2; 5, 1; 11, 1; 13, 1; 89, 1]     [3, 1; 7, 1; 17, 1;
 23, 1; 31, 1]
6   11243154   11243155    [2, 1; 3, 1; 13, 1; 17, 1; 61, 1; 139, 1]        [5, 1;7, 1; 11, 1; 19, 1; 29, 1; 53, 1]
7   965009045   965009046    [5, 1; 7, 1; 11, 1; 13, 1; 23, 1; 83, 1; 101, 1]    [2, 1; 3, 1; 17, 1; 29, 1; 41, 1; 73, 1; 109, 1]
  • Who can extend this table ?
  • Is there an efficient method to find the smallest pair ?
1

There are 1 best solutions below

6
On BEST ANSWER
8 65893166030 65893166031 [2 5 17 19 43 67 73 97] [3 7 11 29 31 41 71 109]

I didn't find a clever solution, and it still takes a very long time. Two small changes:

  • Walk n linearly, calculating omega only once. One has to handle the case of a value satisfying more than one k, but that's easy. This means only one omega call as well as not starting the search over for each k.

  • Use Perl/ntheory, which has a faster omega than Pari/GP. Only 2-3x but that adds up.