login
Numbers n such that the sum of digits of n is divisible by at least one prime divisor of n.
1

%I #24 Sep 05 2015 00:37:27

%S 2,3,4,5,6,7,8,9,12,15,18,20,21,22,24,26,27,28,30,33,36,39,40,42,44,

%T 45,46,48,50,51,54,55,57,60,62,63,64,66,68,69,70,72,75,77,78,80,81,82,

%U 84,86,87,88,90,93,96,99,102,105,108,110,111,112,114,116,117

%N Numbers n such that the sum of digits of n is divisible by at least one prime divisor of n.

%C Sequence is infinite since it contains all positive multiples of 3. - _Michel Marcus_, Sep 04 2015

%C n such that gcd(n, A007953(n)) > 1. - _Robert Israel_, Sep 04 2015

%H Robert Israel, <a href="/A261874/b261874.txt">Table of n, a(n) for n = 1..10000</a>

%e The sum of digits of 15 is 6, and 6 is divisible by 3, a divisors of 15.

%p select(t -> igcd(t, convert(convert(t,base,10),`+`)) > 1, [$1..1000]); # _Robert Israel_, Sep 04 2015

%t fQ[n_] := AnyTrue[First /@ FactorInteger@ n, Divisible[Total@ IntegerDigits@ n, #] &]; Select[Range@ 120, fQ] // Rest (* _Michael De Vlieger_, Sep 04 2015, Version 10 *)

%o (PARI) isok(n) = {sd = sumdigits(n); fordiv(n, d, if (d > 1, if (! (sd % d), return (1))););} \\ _Michel Marcus_, Sep 04 2015

%Y Cf. A007953.

%K nonn,base,easy

%O 1,1

%A _Giovanni Teofilatto_, Sep 04 2015

%E More terms from _Michel Marcus_, Sep 04 2015