login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
OFFSET
1,2
COMMENTS
a(n) <= 10, a(A095050(n)) = 10.
a(A206159(n)) <= 2. - Reinhard Zumkeller, Feb 05 2012
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
A095048 := proc(n)
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:
seq(A095048(n), n=1..80) ; # R. J. Mathar, May 13 2022
PROG
(Haskell)
import Data.List (group, sort)
a095048 = length . group . sort . concatMap show . a027750_row
-- Reinhard Zumkeller, Feb 05 2012
(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)
print([a(n) for n in range(1, 99)]) # Michael S. Branicky, Nov 16 2022
(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
Reinhard Zumkeller, May 28 2004
STATUS
approved