login
Number of common (distinct) digits of consecutive natural numbers.
10

%I #16 Jun 29 2024 10:58:05

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

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

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

%N Number of common (distinct) digits of consecutive natural numbers.

%C a(A226637(n)) = 0. _Reinhard Zumkeller_, Sep 01 2013

%C This is the prefix overlap between the decimal expansions of n and n+1 (cf. A238845). - _N. J. A. Sloane_, Mar 22 2014

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

%t Table[Length[Intersection[IntegerDigits[w], IntegerDigits[w+1]]], {w, 0, 200}]

%o (Haskell)

%o import Data.List (intersect, nub)

%o a076489 n = a076489_list !! n

%o a076489_list = map (length . nub) $

%o zipWith intersect (tail a031298_tabf) a031298_tabf

%o -- _Reinhard Zumkeller_, Sep 01 2013

%Y Cf. A001477, A031298, A076490, A238845, A239092 (partial sums).

%K base,easy,nonn

%O 0,101

%A _Labos Elemer_, Oct 21 2002

%E Initial zero prepended and offset adjusted by _Reinhard Zumkeller_, Sep 01 2013