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.

A038769 Number of digits of n which are divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 0, 2, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 1, 2, 0, 0, 1, 1, 1, 1, 0, 2, 1, 0, 0, 2, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 2, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 2, 2, 1, 2, 2
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

a(A038772(n)) = 0; a(A038770(n)) > 0.

Examples

			a(35)=1 because 5 is a divisor of 35 but 3 is not.
		

Crossrefs

Programs

  • Haskell
    import Data.Char (digitToInt)
    a038769 n = length $ filter (== 0)
                $ map ((mod n) . digitToInt) $ filter (> '0') $ show n
    -- Reinhard Zumkeller, Jun 19 2011
    
  • Magma
    [#[c:c in Intseq(k) |not IsZero(c) and k mod c eq 0]:k in [1..105]]; // Marius A. Burtea, Dec 23 2019
  • Maple
    f:= proc(n) local L; L:= convert(n,base,10);
      nops(select(t -> t > 0 and n mod t = 0, L))
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jul 04 2016
  • Mathematica
    Array[Count[Position[Most@ DigitCount@ #, ?(# > 0 &)][[All, 1]], k /; Mod[#, k] == 0] &, 105] (* Michael De Vlieger, Dec 23 2019 *)
    Table[Count[n/Select[IntegerDigits[n],#>0&],?IntegerQ],{n,110}] (* _Harvey P. Dale, Mar 04 2023 *)