login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A107846 Number of duplicate digits of n. 3

%I

%S 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,

%T 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,

%U 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0

%N Number of duplicate digits of n.

%C a(A010784(n)) = 0; a(A109303(n)) > 0. - _Reinhard Zumkeller_, Jul 09 2013

%H Reinhard Zumkeller, <a href="/A107846/b107846.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A055642(n) - A043537(n).

%e a(11) = 1 because 11 has two total decimal digits but only one distinct digit (1) and 2-1=1.

%e Similarly, a(3653135) = 7 (total digits) - 4 (distinct digits: 1,3,5,6) = 3 (There are three duplicate digits here, namely, 3, 3 and 5).

%p A107846:=proc(q) local a,b,c,n;

%p for n from 0 to q do a:=n; b:=[];

%p while a>0 do c:=a mod 10; b:=[op(b),c]; a:=trunc(a/10); od;

%p a:=nops(b); b:=nops({op(b)}); print(a-b);

%p od; end: A107846(10^4); # _Paolo P. Lava_, Apr 18 2013

%t Table[Total[Select[DigitCount[n]-1,#>0&]],{n,0,120}] (* _Harvey P. Dale_, Jul 31 2013 *)

%o (Haskell)

%o import Data.List (sort, group)

%o a107846 = length . concatMap tail . group . sort . show :: Integer -> Int

%o -- _Reinhard Zumkeller_, Jul 09 2013

%Y Cf. A055642 (Total decimal digits of n), A043537 (Distinct decimal digits of n).

%K base,easy,nonn

%O 0,1

%A _Rick L. Shepherd_, May 24, 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 11 05:05 EDT 2021. Contains 342886 sequences. (Running on oeis4.)