login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A107846 Number of duplicate digits of n. 3
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

a(A010784(n)) = 0; a(A109303(n)) > 0. - Reinhard Zumkeller, Jul 09 2013

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

FORMULA

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

EXAMPLE

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

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).

MAPLE

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

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

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

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

od; end: A107846(10^4); # Paolo P. Lava, Apr 18 2013

MATHEMATICA

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

PROG

(Haskell)

import Data.List (sort, group)

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

-- Reinhard Zumkeller, Jul 09 2013

CROSSREFS

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

Sequence in context: A088918 A011726 A070109 * A179801 A065202 A045701

Adjacent sequences:  A107843 A107844 A107845 * A107847 A107848 A107849

KEYWORD

base,easy,nonn

AUTHOR

Rick L. Shepherd, May 24, 2005

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified August 24 00:29 EDT 2017. Contains 291052 sequences.