login
Numbers k such that the sum of the digits of k is a prime factor of k.
2

%I #14 Jun 29 2018 02:15:58

%S 2,3,5,7,12,20,21,30,50,70,102,110,111,120,133,140,200,201,209,210,

%T 230,247,300,308,320,322,364,407,410,476,481,500,506,511,605,629,700,

%U 704,715,782,803,832,874,902,935,1002,1010,1011,1015,1020,1040,1066,1088

%N Numbers k such that the sum of the digits of k is a prime factor of k.

%H Harry J. Smith, <a href="/A062713/b062713.txt">Table of n, a(n) for n = 1..1000</a>

%e 2 is an element since 2 is a prime factor of 2; 12 is an element since 1 + 2 = 3 and 3 is a prime factor of 12.

%t sdpfQ[n_]:=MemberQ[Transpose[FactorInteger[n]][[1]],Total[ IntegerDigits[ n]]]; Select[Range[2,1100],sdpfQ] (* _Harvey P. Dale_, Sep 24 2012 *)

%o (PARI) ok(k)={my(s=sumdigits(k)); k % s==0 && isprime(s)} \\ _Andrew Howroyd_, Jun 28 2018

%K nonn,base,easy

%O 1,1

%A Lisa O Coulter (lisa_coulter(AT)my-deja.com), Jul 14 2001

%E Corrected and extended by Larry Reeves (larryr(AT)acm.org) and _Dean Hickerson_, Jul 16 2001