A076490 Number of common (distinct) digits of consecutive prime numbers.
0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 1, 2, 0, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2
Offset: 1
Examples
1 to 9 common digits for {11 and 13},{101,103},{1031,1033}, {10223,10243},{97213,97231},{126079,126097},{1206479,1206497}, {10186237,10186273},{100438279,100438297} respectively.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.List (intersect, nub); import Data.Function (on) a076490 n = a076490_list !! n a076490_list = map (length . nub) $ zipWith (intersect `on` show) (tail a000040_list) a000040_list -- Reinhard Zumkeller, Sep 01 2013
-
Mathematica
Table[Length[Intersection[IntegerDigits[Prime[w]], IntegerDigits[ Prime[ w+1]]]], {w, 1, 200}] (* corrected by Harvey P. Dale, May 14 2014 *) Length[Intersection@@IntegerDigits[#]]&/@Partition[Prime[Range[110]],2,1] (* Harvey P. Dale, May 14 2014 *)
-
PARI
a(n) = my(p=prime(n)); #setintersect(Set(digits(p)), Set(digits(nextprime(p+1)))); \\ Michel Marcus, Mar 27 2023