|
|
A038769
|
|
Number of digits of n which are divisors of n.
|
|
8
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,11
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(35)=1 because 5 is a divisor of 35 but 3 is not.
|
|
MAPLE
|
f:= proc(n) local L; L:= convert(n, base, 10);
nops(select(t -> t > 0 and n mod t = 0, L))
end proc:
|
|
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 *)
|
|
PROG
|
(Haskell)
import Data.Char (digitToInt)
a038769 n = length $ filter (== 0)
$ map ((mod n) . digitToInt) $ filter (> '0') $ show n
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|