OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..445 (first 58 terms from Magnus Bergwall)
EXAMPLE
28: digit sum: 2+8=10 and sum of prime factors: 2+2+7=11;
62300: digit sum: 6+2+3+0+0=11 and sum of prime factors: 2+2+5+5+7+89=110.
MAPLE
dmax:= 6: N:= 10^dmax: # to get all terms <= N
dsmax:= dmax*9:
dsums:= select(t -> convert(convert(t, base, 10), set) subset {0, 1}, {$0..dsmax}):
f:= proc(C, s, digs)
if C[1] > 10 or max(C[2..-1]-C[1..-2]) > 10 or C[-1] < digs+s-10 then return NULL fi;
-(10^digs-1)/9 - 9* add(C[i]*10^(i-1), i=1..digs-1) + (digs+s)*10^(digs-1) end proc:
sort(select(t -> convert(convert(convert(map(`*`@op, ifactors(t)[2]), `+`), base, 10), set) subset {0, 1},
[seq(seq(f(C, s, dmax), C = combinat:-choose(s+dmax-1, dmax-1)), s=dsums)])); # Robert Israel, Jun 03 2018
MATHEMATICA
zo[n_] := Max[IntegerDigits[n]] <= 1; Select[Range[0, 10^6], #<=1 || (zo[ Total[ IntegerDigits[#]]] && zo@ Total[ Times @@@ FactorInteger[#]]) &] (* Giovanni Resta, Apr 03 2018 *)
PROG
(PARI) isb(n) = (n==0) || vecmax(digits(n)) <= 1;
spf(n) = my(f=factor(n)); sum(k=1, #f~, f[k, 1]*f[k, 2]);
isok(n) = isb(sumdigits(n)) && isb(spf(n)); \\ Michel Marcus, Apr 03 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Magnus Bergwall, Jan 01 2018
STATUS
approved