cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A038770 Numbers divisible by at least one of their digits.

This page as a plain text file.
%I A038770 #53 Mar 29 2024 16:33:32
%S A038770 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,28,
%T A038770 30,31,32,33,35,36,39,40,41,42,44,45,48,50,51,52,55,60,61,62,63,64,65,
%U A038770 66,70,71,72,75,77,80,81,82,84,85,88,90,91,92,93,95,96,99,100,101,102
%N A038770 Numbers divisible by at least one of their digits.
%C A038770 A038769(a(n)) > 0; complement of A038772.
%C A038770 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
%H A038770 Reinhard Zumkeller, <a href="/A038770/b038770.txt">Table of n, a(n) for n = 1..10000</a>
%H A038770 <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>
%F A038770 a(n) ~ n. - _Charles R Greathouse IV_, Jul 22 2011
%e A038770 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.
%t A038770 Select[Range[120],MemberQ[Divisible[#,Cases[IntegerDigits[#],Except[0]]], True]&] (* _Harvey P. Dale_, Jun 20 2011 *)
%t A038770 Select[Range[120],AnyTrue[#/DeleteCases[IntegerDigits[#],0],IntegerQ]&] (* _Harvey P. Dale_, Mar 29 2024 *)
%o A038770 (Haskell)
%o A038770 a038770 n = a038770_list !! (n-1)
%o A038770 a038770_list = filter f [1..] where
%o A038770    f u = g u where
%o A038770      g v = v > 0 && (((d == 0 || r > 0) && g v') || r == 0)
%o A038770            where (v',d) = divMod v 10; r = mod u d
%o A038770 -- _Reinhard Zumkeller_, Jul 30 2015, Jun 19 2011
%o A038770 (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
%o A038770 (Python)
%o A038770 def ok(n): return any(n%int(d) == 0 for d in str(n) if d != '0')
%o A038770 print(list(filter(ok, range(1, 103)))) # _Michael S. Branicky_, May 20 2021
%Y A038770 Cf. A327560 (counts), A038772 (complement), A034709, A034837, A038769.
%K A038770 base,easy,nonn,nice
%O A038770 1,2
%A A038770 _Henry Bottomley_, May 04 2000