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.

A095048 Number of distinct digits needed to write all positive divisors of n in decimal representation.

This page as a plain text file.
%I A095048 #22 Nov 16 2022 14:53:54
%S A095048 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,
%T A095048 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,
%U A095048 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
%N A095048 Number of distinct digits needed to write all positive divisors of n in decimal representation.
%C A095048 a(n) <= 10, a(A095050(n)) = 10.
%C A095048 a(A206159(n)) <= 2. - _Reinhard Zumkeller_, Feb 05 2012
%C A095048 Almost all (in the sense of natural density) terms of this sequence are equal to 10. - _Charles R Greathouse IV_, Nov 16 2022
%H A095048 Reinhard Zumkeller, <a href="/A095048/b095048.txt">Table of n, a(n) for n = 1..10000</a>
%e A095048 Set of divisors of n=10: {1,2,5,10}, therefore a(10) = #{0,1,2,5} = 4.
%e A095048 Set of divisors of n=16: {1,2,4,8,16}, therefore a(16)=#{1,2,4,6,8} = 5.
%p A095048 A095048 := proc(n)
%p A095048     local digset ;
%p A095048     digset := {} ;
%p A095048     for d in numtheory[divisors](n) do
%p A095048         digset := digset union convert(convert(d,base,10),set) ;
%p A095048     end do:
%p A095048     nops(digset) ;
%p A095048 end proc:
%p A095048 seq(A095048(n),n=1..80) ; # _R. J. Mathar_, May 13 2022
%o A095048 (Haskell)
%o A095048 import Data.List (group, sort)
%o A095048 a095048 = length . group . sort . concatMap show . a027750_row
%o A095048 -- _Reinhard Zumkeller_, Feb 05 2012
%o A095048 (Python)
%o A095048 from sympy import divisors
%o A095048 def a(n):
%o A095048     s = set("1"+str(n))
%o A095048     if len(s) == 10: return 10
%o A095048     for d in divisors(n, generator=True):
%o A095048         s |= set(str(d))
%o A095048         if len(s) == 10: return 10
%o A095048     return len(s)
%o A095048 print([a(n) for n in range(1, 99)]) # _Michael S. Branicky_, Nov 16 2022
%o A095048 (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
%Y A095048 Cf. A095049, A095050, A043537.
%Y A095048 Cf. A027750, A059436.
%K A095048 nonn,base
%O A095048 1,2
%A A095048 _Reinhard Zumkeller_, May 28 2004