OFFSET
1,1
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
225 is in the sequence as 225 is divisible by 2 + 2 + 5 = 9 but not by 2 while 2 is a digit of 225. - David A. Corneth, Jan 28 2021
PROG
(PARI) is(n) = { my(d = digits(n), sd = vecsum(d), s = Set(d)); if(sd != 0 && n % sd == 0, if(s[1] == 0, return(1) ); for(i = 1, #s, if(n % s[i] != 0, return(1) ) ); 0 ); 0 } \\ David A. Corneth, Jan 28 2021
(Python)
def ok(n):
d = list(map(int, str(n)))
if n == 0 or n%sum(d): return False
return 0 in d or any(n%di for di in set(d))
print([k for k in range(271) if ok(k)]) # Michael S. Branicky, Oct 18 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Aug 18 2003
STATUS
approved