OFFSET
1,2
COMMENTS
a(n) == 0 or 1 (mod 9). If a(n) == 0 (mod 9), a(n) == 0 (mod 27).
EXAMPLE
4158 = 2*3^3*7*11 is in the sequence because 4 + 1 + 5 + 8 = 18, and:
4158/2 = 2079 and digsum(2079) = 18;
4158/3 = 1386 and digsum(1386) = 18;
4158/7 = 594 and digsum(594) = 18;
4158/11 = 378 and digsum(378) = 18.
MAPLE
with(numtheory):nn:=4200:
for k from 1 to nn do:
d:=factorset(k):n1:=nops(d):it:=0:
b:=convert(k, base, 10):n2:=nops(b):s:=sum(‘b[i]’, ‘i’=1..n2):
for i from 1 to n1 do:
x:=k/d[i]:b1:=convert(x, base, 10):n3:=nops(b1):
s1:=sum(‘b1[i]’, ‘i’=1..n3):
if s1=s
then
it:=it+1:
else
fi:
od:
if it=n1
then
printf(`%d, `, k):
else
fi:
od:
MATHEMATICA
sod[n_] := Total@IntegerDigits@n; Select[Range[1, 5000], {sod[#]} == Union[sod /@ (#/First /@ FactorInteger[#])] &] (* Giovanni Resta, Mar 12 2019 *)
PROG
(PARI) isok(k) = {my(pf = factor(k)[, 1]~, sd = sumdigits(k)); for (i=1, #pf, if (sumdigits(k/pf[i]) != sd, return (0)); ); return (1); } \\ Michel Marcus, Mar 12 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Mar 12 2019
STATUS
approved