OFFSET
1,2
COMMENTS
MAPLE
filter:= proc(n) local s; s:= convert(convert(n, base, 10), `+`); s mod numtheory:-tau(s) = 0 end proc:
select(filter, [$1..200]); # Robert Israel, Aug 10 2022
MATHEMATICA
refQ[n_] := Divisible[n, DivisorSigma[0, n]]; Select[Range[2000], refQ[Plus @@ IntegerDigits[#]] &] (* Amiram Eldar, Aug 10 2022 *)
PROG
(Python)
from sympy import divisor_count
def ok(n): sd = sum(map(int, str(n))); return sd%divisor_count(sd) == 0
print([k for k in range(1, 200) if ok(k)]) # Michael S. Branicky, Aug 10 2022
(PARI) isok(k) = my(s=sumdigits(k)); denominator(s/numdiv(s)) == 1; \\ Michel Marcus, Aug 10 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Ctibor O. Zizka, Aug 10 2022
STATUS
approved