OFFSET
1,1
COMMENTS
14 is the only even number in the sequence, since 2 is the only even prime and p-2 grows much faster than the digit sum of 2p.
LINKS
James Beyer, Table of n, a(n) for n = 1..1000
James Beyer, Numbers Like Fourteen
Wikipedia, Digit sum
Wikipedia, Semiprime
EXAMPLE
14=2*7 and 1+4=7-2.
95=5*19 and 9+5=19-5.
527=17*31 and 5+2+7=31-17.
MATHEMATICA
Take[Sort@ Reap[ Do[ If[PrimeQ[q + g] && g == Total@ IntegerDigits[n = q (q + g)], Sow@n], {g, 9*9}, {q, Prime@ Range@ 2000}]][[2, 1]], 100] (* Giovanni Resta, Jul 25 2019 *)
spdpfQ[n_]:=Module[{f=FactorInteger[n][[All, 1]]}, PrimeOmega[n]== 2 && Total[ IntegerDigits[n]]==f[[2]]-f[[1]]]; Select[Range[ 21*10^5], spdpfQ]// Quiet (* or *) Times@@@Select[Subsets[Prime[ Range[ 300]], {2}], #[[2]]-#[[1]]==Total[IntegerDigits[#[[1]]#[[2]]]]&] (* Harvey P. Dale, Oct 14 2021 *)
PROG
(PARI) isok(n) = (bigomega(n) == 2) && (f=factor(n)) && (#f~ == 2) && (sumdigits(n) == f[2, 1] - f[1, 1]); \\ Michel Marcus, Jun 29 2019
(Magma) [n:n in [2..2100000]|IsSquarefree(n) and #PrimeDivisors(n) eq 2 and PrimeDivisors(n)[2]-PrimeDivisors(n)[1] eq &+Intseq(n)]; // Marius A. Burtea, Jul 27 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James Beyer, Jun 26 2019
STATUS
approved