login
Numbers m with the property that, when a and b are positive integers such that a*b = m, |a-b| is prime.
3

%I #24 Mar 04 2023 02:10:08

%S 3,8,14,18,38,62,98,138,230,258,278,318,338,390,398,402,458,542,678,

%T 710,770,798,822,938,1022,1118,1202,1238,1298,1322,1490,1622,1658,

%U 2030,2222,2238,2378,2438,2522,2558,2618,2858,2910,3002,3218,3230,3698,4058,4178

%N Numbers m with the property that, when a and b are positive integers such that a*b = m, |a-b| is prime.

%C All numbers in this sequence are congruent to 0 or 2 mod 3.

%C It is not known if this sequence is infinite. For n > 1 all terms are even.

%C The intersection with A080715 seems to be empty. Is this provable ?

%C From _Amiram Eldar_, Nov 15 2021: (Start)

%C The nonsquarefree terms of this sequence, 8, 18, 98, 338, ..., are numbers of the form 2*p^2, where p is in A349327.

%C The least terms with 1, 2, 3, 4 and 5 distinct prime divisors are 3, 14, 138, 390 and 13576178, respectively. Are there terms with more than 5 distinct prime divisors? (End)

%C All terms have either 6 (for a(n) = 2*A349327^2) or 2^k (for a(n) in A005117) divisors. - _Samuel Harkness_, Mar 02 2023

%H Amiram Eldar, <a href="/A179993/b179993.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Alois P. Heinz)

%e Example : For n = 5, the possible values of |a-b| are 17 = 19-2 and 37 = 38-1.

%t m=1;While[m < 10000, m++; If[Mod[m, 3] == 1, , V = Divisors[m]; L = Length[V]; j = 0; While[j < L/2, j++; x = (m/V[[j]]) - V[[j]]; If[PrimeQ[x], , j = L]]; If[j == L/2, X = Append[X, m],]]]; X

%t q[n_] := AllTrue[Divisors[n], #^2 > n || PrimeQ[Abs[# - n/#]] &]; Select[Range[4000], q] (* _Amiram Eldar_, Nov 15 2021 *)

%o (Python)

%o from itertools import islice, takewhile, count

%o from sympy import isprime, divisors

%o def A179993(): # generator of terms

%o for m in count(1):

%o if all(isprime(m//a-a) for a in takewhile(lambda x: x*x <= m, divisors(m))):

%o yield m

%o A179993_list = list(islice(A179993(),20)) # _Chai Wah Wu_, Nov 15 2021

%Y Cf. A080715, A349327, A005117.

%K easy,nonn

%O 1,1

%A _Emmanuel Vantieghem_, Aug 05 2010, Aug 06 2010