OFFSET
1,1
COMMENTS
The number of times this process can be repeated would be called the order of the number. For example, 82 is the smallest number of this type of order 2.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
51 is a number of this type since 51=3*17 and 17-3=14 are also the product of two distinct primes.
MAPLE
N:= 10^4: # to get all terms <= N
P:= select(isprime, [2, seq(i, i=3..N, 2)]):
P2:= {}:
for i from 1 to nops(P) while P[i]^2 <= N do
for j from i+1 while P[i]*P[j] <= N do od:
P2:= P2 union {seq(P[i]*P[k], k=i+1..j-1)};
od:
P3:= {}:
for i from 1 to nops(P) while P[i]^2 <= N do
for j from i+1 while P[i]*P[j] <= N do od:
Q:= map(`-`, convert(P[i+1..j-1], set), P[i]) intersect P2;
P3:= P3 union map(t -> (t+P[i])*P[i], Q);
od:
sort(convert(P3, list)); # Robert Israel, Jan 05 2018
MATHEMATICA
Select[Range[6, 614], And[AllTrue[#, PrimeQ], Length@ # == 2, FactorInteger[First@ Differences@ #][[All, -1]] == {1, 1}] &@ Most@ Rest@ Divisors@ # &] (* Michael De Vlieger, Dec 13 2017 *)
PROG
(Sage)
for n in range(1, 100):
L=list(factor(n))
itsemiprime=false
degree=-1
if len(L)==2 and L[0][1]==1 and L[1][1]==1:
itsemiprime=true
while len(L)==2:
if L[0][1]==1 and L[1][1]==1:
L=list(factor(L[1][0]-L[0][0]))
temp=len(L)
degree=degree+1
else:
break
if itsemiprime:
n, degree
(PARI) isok1(n) = (bigomega(n)==2) && issquarefree(n);
isok(n) = isok1(n) && (f=factor(n)) && isok1(f[2, 1]-f[1, 1]); \\ Michel Marcus, Dec 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl Lienert and Pamela K. M. Smith, Dec 04 2017
STATUS
approved