|
|
A095048
|
|
Number of distinct digits needed to write all positive divisors of n in decimal representation.
|
|
15
|
|
|
1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 1, 5, 2, 4, 3, 5, 2, 6, 2, 5, 4, 2, 3, 6, 3, 4, 5, 5, 3, 6, 2, 6, 2, 5, 4, 7, 3, 5, 3, 6, 2, 6, 3, 3, 5, 5, 3, 6, 4, 4, 4, 6, 3, 9, 2, 7, 5, 5, 3, 7, 2, 4, 6, 6, 4, 4, 3, 7, 5, 7, 2, 8, 3, 5, 5, 8, 2, 7, 3, 7, 6, 4, 3, 7, 4, 6, 6, 4, 3, 9, 4, 6, 3, 5, 3, 7, 3, 6, 3, 5, 2, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Almost all (in the sense of natural density) terms of this sequence are equal to 10. - Charles R Greathouse IV, Nov 16 2022
|
|
LINKS
|
|
|
EXAMPLE
|
Set of divisors of n=10: {1,2,5,10}, therefore a(10) = #{0,1,2,5} = 4.
Set of divisors of n=16: {1,2,4,8,16}, therefore a(16)=#{1,2,4,6,8} = 5.
|
|
MAPLE
|
local digset ;
digset := {} ;
for d in numtheory[divisors](n) do
digset := digset union convert(convert(d, base, 10), set) ;
end do:
nops(digset) ;
end proc:
|
|
PROG
|
(Haskell)
import Data.List (group, sort)
a095048 = length . group . sort . concatMap show . a027750_row
(Python)
from sympy import divisors
def a(n):
s = set("1"+str(n))
if len(s) == 10: return 10
for d in divisors(n, generator=True):
s |= set(str(d))
if len(s) == 10: return 10
return len(s)
(PARI) a(n) = my(d = divisors(n), s = 0); for(i = 1, #d, v = digits(d[i]); for(j = 1, #v, s = bitor(s, 1<<v[j]); if(s == 1023, return(10)))); hammingweight(s) \\ David A. Corneth, Nov 16 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|