login
Numbers n with property that n is divisible by (at least one) sum of two its positive digits.
2

%I #2 Mar 30 2012 17:26:31

%S 12,18,21,24,27,36,42,45,48,54,63,72,81,84,102,108,110,112,114,116,

%T 118,120,123,126,129,132,136,140,144,145,150,156,161,162,165,168,176,

%U 180,189,190,192,196,198,201,204,207,209,210,212,213,216,219,220,224,228

%N Numbers n with property that n is divisible by (at least one) sum of two its positive digits.

%e 12=(1+2)*4, 102=(1+2)*34, 297=(2+7)*33.

%t A171674=Reap[Do[id=Select[IntegerDigits[n],#>0&];su2=Total/@Subsets[id,{2}];Le=Length[su2];Do[x=su2[[k]];If[Mod[n,x]==0,Sow[n];Break[]],{k,Le}],{n,12,30000}]][[2,1]];

%Y Cf. A005349 Niven (or Harshad) numbers: numbers that are divisible by the sum of their digits, A171674 Squares divisible by (at least one) sum of two their positive digits.

%K base,nonn

%O 1,1

%A _Zak Seidov_, Dec 15 2009