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.

A038772 Numbers not divisible by any of their digits.

Original entry on oeis.org

23, 27, 29, 34, 37, 38, 43, 46, 47, 49, 53, 54, 56, 57, 58, 59, 67, 68, 69, 73, 74, 76, 78, 79, 83, 86, 87, 89, 94, 97, 98, 203, 207, 209, 223, 227, 229, 233, 239, 247, 249, 253, 257, 259, 263, 267, 269, 277, 283, 289, 293, 299, 307, 308, 323, 329, 334, 337, 338
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

A038769(a(n)) = 0; complement of A038770.
This is a regular language when written in decimal, though the minimal regular expression is probably thousands of characters long. - Charles R Greathouse IV, Aug 19 2011
Exponential density 0.954... = A104139. Asymptotically 8/35 * n^0.954... + O(n^0.903...) members up to n. - Charles R Greathouse IV, Jul 22 2012

Examples

			34 is divisible by neither 3 nor 4.
35 is excluded because 5 is a divisor of 35, but 37 is included because neither 3 nor 7 is a divisor of 37
		

Crossrefs

Cf. A327561 (counts), A038770 (complement).
Cf. also A034709, A034837, A038769.

Programs

  • Haskell
    import Data.Char (digitToInt)
    a038772 n = a038772_list !! (n-1)
    a038772_list = filter p [1..] where
       p n = all (> 0) $ map ((mod n) . digitToInt) $ filter (> '0') $ show n
    -- Reinhard Zumkeller, Jun 19 2011
    
  • Magma
    [k:k in [1..340]| forall{c:c in Set(Intseq(k)) diff {0}|k mod c ne 0}]; // Marius A. Burtea, Dec 22 2019
    
  • Mathematica
    nddQ[n_]:=Module[{idn=DeleteCases[IntegerDigits[n],0]},And@@Table[ !Divisible[n, idn[[i]]],{i,Length[idn]}]]; Select[Range[350],nddQ] (* Harvey P. Dale, Nov 01 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(0))); 1 \\ Charles R Greathouse IV, Jul 22 2011
    
  • Python
    def ok(n): return not any(n%int(d) == 0 for d in str(n) if d != '0')
    print(list(filter(ok, range(1, 339)))) # Michael S. Branicky, May 20 2021

Extensions

Edited by N. J. A. Sloane, Nov 17 2008 at the suggestion of R. J. Mathar

A327560 The number of integers m in the range 0 < m < 10^n which are divisible by one or more of their own digits (A038770).

Original entry on oeis.org

9, 68, 708, 7578, 79952, 832506, 8585583, 87944417, 896452992, 9104962748, 92222435013, 932113080563, 9405187219507, 94771322677210, 953907792350911, 9592689086414459, 96392955785210896, 967997194404428275, 9715595409791983073
Offset: 1

Views

Author

Kevin Ryde, Sep 16 2019

Keywords

Comments

The integers m counted are A038770, so A038770(a(n)) = 10^n-1 is the last of n digits, and A038770(a(n)+1) = 10^n is the first of n+1 digits, for n>=1.
The digit divisibility condition is a regular language so a(n) is a linear recurrence. Working through a state machine for A038770 shows the recurrence is order 984, though its characteristic polynomial factorizes over rationals into terms of orders at most 36. The recurrence begins at a(4)..a(987) giving a(988). See the links for coefficients and generating function.
The biggest root (by magnitude) of the recurrence characteristic polynomial is 10 and its g.f. coefficient is 1 which shows a(n) -> 10^n. Or simply the number of m containing at least one digit 1 (a subset of those counted here) approaches 10^n per A016189.

Crossrefs

Cf. A038770 (digit strings), A327561 (opposite counts).

Programs

Formula

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