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.

Showing 1-2 of 2 results.

A038770 Numbers divisible by at least one of their digits.

Original entry on oeis.org

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, 30, 31, 32, 33, 35, 36, 39, 40, 41, 42, 44, 45, 48, 50, 51, 52, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 75, 77, 80, 81, 82, 84, 85, 88, 90, 91, 92, 93, 95, 96, 99, 100, 101, 102
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

A038769(a(n)) > 0; complement of A038772.
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

Examples

			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.
		

Crossrefs

Cf. A327560 (counts), A038772 (complement), A034709, A034837, A038769.

Programs

  • 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
    
  • 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 *)
  • 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

Formula

a(n) ~ n. - Charles R Greathouse IV, Jul 22 2011

A327561 The number of integers m in the range 0 < m < 10^n which are not divisible by any of their own digits (A038772).

Original entry on oeis.org

0, 31, 291, 2421, 20047, 167493, 1414416, 12055582, 103547007, 895037251, 7777564986, 67886919436, 594812780492, 5228677322789, 46092207649088, 407310913585540, 3607044214789103, 32002805595571724, 284404590208016926
Offset: 1

Views

Author

Kevin Ryde, Sep 19 2019

Keywords

Comments

The integers m counted are A038772 so that A038772(a(n)) is the last there of n digits and A038772(a(n)+1) is the first there of n+1 digits, for n>=2.
The digit divisibility condition is a regular language so a(n) is a linear recurrence. Working through a state machine for A038772 (or its complement A038770) shows the recurrence is order 983, though its characteristic polynomial factorizes over rationals into terms of orders at most 36. The recurrence begins at a(4..986) giving a(987). See the links for recurrence coefficients and generating function.
The biggest root (by magnitude) of the characteristic polynomial is 9 and its g.f. coefficient is 4/21 which shows a(n) -> (4/21)*9^n.

Crossrefs

Formula

a(n) = 10^n-1 - A327560(n).
Showing 1-2 of 2 results.