|
|
A297614
|
|
Numbers with property that both the digit sum and the sum of the prime factors (counted with multiplicity) have only digits 0 and 1 in base 10.
|
|
1
|
|
|
0, 1, 28, 218, 721, 1261, 1414, 2018, 2134, 2701, 3115, 3232, 11431, 14131, 15211, 20018, 20540, 22231, 23140, 23240, 27001, 31025, 33022, 40016, 44020, 51212, 62002, 62300, 111250, 112141, 112420, 113230, 120080, 134300
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|