login
Numbers that have at least two divisors with an equal sum of digits.
4

%I #22 Jan 13 2023 11:32:44

%S 10,12,18,20,21,22,24,27,30,36,40,42,44,45,48,50,52,54,60,63,66,70,72,

%T 80,81,84,88,90,96,100,102,104,105,108,110,111,112,114,115,117,120,

%U 124,126,130,132,133,135,136,140,144,147,150,152,153,154,156,160,162,165

%N Numbers that have at least two divisors with an equal sum of digits.

%C If k is a term, then so are all multiples of k. - _Robert Israel_, Dec 20 2022

%H Harvey P. Dale, <a href="/A359074/b359074.txt">Table of n, a(n) for n = 1..1000</a>

%e 24 is a term since it has two pairs of divisors having an equal sum of digits: 3 and 12; 6 and 24.

%p q:= n-> (s-> is(nops(s)>nops({s[]})))(map(x-> add(i, i=convert(x,

%p base, 10)), [numtheory[divisors](n)[]])):

%p select(q, [$1..165])[]; # _Alois P. Heinz_, Dec 18 2022

%t a={}; For[k=1, k<=165, k++, If[Length[Intersection[Table[Total[Part[IntegerDigits[Divisors[k]], i]], {i, DivisorSigma[0, k]}]]] < DivisorSigma[0, k],AppendTo[a, k]]]; a

%t tdesQ[n_]:=AnyTrue[Tally[Total[IntegerDigits[#]]&/@Divisors[n]][[All,2]],#>1&]; Select[ Range[200],tdesQ] (* _Harvey P. Dale_, Jan 13 2023 *)

%o (Python)

%o from sympy import divisors

%o def sod(n): return sum(map(int, str(n)))

%o def ok(n):

%o s = set()

%o for d in divisors(n, generator=True):

%o sd = sod(d)

%o if sd in s: return True

%o s.add(sd)

%o return False

%o print([k for k in range(166) if ok(k)]) # _Michael S. Branicky_, Dec 15 2022

%o (PARI) isok(k) = my(d=divisors(k)); #Set(apply(sumdigits, d)) < #d; \\ _Michel Marcus_, Dec 19 2022

%Y Complement of A359075.

%Y Cf. A000005, A007953, A359076 (proper divisors).

%K nonn,base

%O 1,1

%A _Stefano Spezia_, Dec 15 2022