Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #8 Mar 08 2020 21:37:17
%S 1,2,3,4,5,6,7,8,9,10,19,20,30,40,50,60,70,80,90,91,100,109,118,119,
%T 127,128,129,136,137,146,155,157,159,163,164,166,168,172,173,175,181,
%U 182,186,190,191,192,195,199,200,208,217,218,219,228
%N Numbers n such that n shares at least one digit with both the sum of its digits and the product of its digits.
%C Has A050278 as subsequence.
%H Robert Israel, <a href="/A108193/b108193.txt">Table of n, a(n) for n = 1..10000</a>
%e 238 shares the digit 3 with the sum of its digits (13) and shares the digit 8 with the product of its digits (48).
%p filter:= proc(n) local L,S,Ss,Sp;
%p L:= convert(n,base,10);
%p S:= convert(L,set);
%p Ss:= convert(convert(convert(L,`+`),base,10),set);
%p if S intersect Ss = {} then return false fi;
%p Sp:= convert(convert(convert(L,`*`),base,10),set);
%p S intersect Sp <> {}
%p end proc:
%p select(filter, [$1..500]); # _Robert Israel_, Mar 06 2020
%t Select[Range[0, 250], Length[Intersection[IntegerDigits[ # ], IntegerDigits[ Plus @@ IntegerDigits[ # ]]]] > 0 && Length[Intersection[IntegerDigits[ # ], IntegerDigits[Times @@ IntegerDigits[ # ]]]] > 0 &]
%Y Cf. A050278.
%K base,easy,nonn
%O 1,2
%A _Eric Angelini_, Jun 15 2005
%E Edited and corrected by _Stefan Steinerberger_, Jun 30 2007