OFFSET
1,2
COMMENTS
The decimal digit strings of this sequence are a regular language, since it is the union of A011531 and A121022 .. A121029 which are likewise regular languages. Some computer state machine manipulation for this union shows a minimum deterministic finite automaton (DFA) matching the digit strings of this sequence has 11561 states. Reversing strings (so least significant digit first) reduces to 1699 states, or reverse and allow high 0's (which become trailing 0's due to the reverse) reduces to 1424 states. The latter are tractable sizes for the linear recurrence in A327560. - Kevin Ryde, Dec 04 2019
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ n. - Charles R Greathouse IV, Jul 22 2011
EXAMPLE
35 is included because 5 is a divisor of 35, but 37 is not included because neither 3 nor 7 is a divisor of 37.
MATHEMATICA
Select[Range[120], MemberQ[Divisible[#, Cases[IntegerDigits[#], Except[0]]], True]&] (* Harvey P. Dale, Jun 20 2011 *)
Select[Range[120], AnyTrue[#/DeleteCases[IntegerDigits[#], 0], IntegerQ]&] (* Harvey P. Dale, Mar 29 2024 *)
PROG
(Haskell)
a038770 n = a038770_list !! (n-1)
a038770_list = filter f [1..] where
f u = g u where
g v = v > 0 && (((d == 0 || r > 0) && g v') || r == 0)
where (v', d) = divMod v 10; r = mod u d
-- Reinhard Zumkeller, Jul 30 2015, Jun 19 2011
(PARI) is(n)=my(v=vecsort(eval(Vec(Str(n))), , 8)); for(i=if(v[1], 1, 2), #v, if(n%v[i]==0, return(1))); 0 \\ Charles R Greathouse IV, Jul 22 2011
(Python)
def ok(n): return any(n%int(d) == 0 for d in str(n) if d != '0')
print(list(filter(ok, range(1, 103)))) # Michael S. Branicky, May 20 2021
CROSSREFS
KEYWORD
base,easy,nonn,nice
AUTHOR
Henry Bottomley, May 04 2000
STATUS
approved