OFFSET
1,2
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10314
Rémy Sigrist, PARI program
EXAMPLE
The number 240 is divisible by 2, 24, 240, 4 and 40, so 240 belongs to this sequence.
MATHEMATICA
Select[Range[880], AllTrue[#/Select[FromDigits/@Subsequences[IntegerDigits[#]], #>0&], IntegerQ]&] (* James C. McMahon, May 13 2025 *)
PROG
(PARI) is(n, base = 10) = {
my (d = digits(n, base));
for (i = 1, #d,
if (d[i],
for (j = i, #d,
if (n % fromdigits(d[i..j], base),
return (0); ); ); ); );
return (1); }
(PARI) \\ See Links section.
(Python)
def ok(n):
s = str(n)
subs = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1) if s[i]!='0')
return n and all(n%v == 0 for ss in subs if (v:=int(ss)) > 0)
print([k for k in range(1000) if ok(k)]) # Michael S. Branicky, May 09 2025
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, May 01 2025
STATUS
approved
