login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A063660
Min{ m | m > n and both numbers have at least one common decimal digit}.
3
10, 10, 12, 13, 14, 15, 16, 17, 18, 19, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 31, 32, 33, 34, 35, 36, 37, 38, 39, 43, 41, 42, 43, 44, 45, 46, 47, 48, 49, 54, 51, 52, 53, 54, 55, 56, 57, 58, 59, 65, 61, 62, 63, 64, 65, 66, 67, 68, 69
OFFSET
0,1
LINKS
MATHEMATICA
nmax = 100; XhasD[x_, d_] := MemberQ[IntegerDigits[x], d]; Reap[For[n = 0, n <= nmax, n++, For[m = n+1, m <= 10*n + 10, m++, a = m; b = False; For[d = 0, d <= 9, d++, If[XhasD[n, d] && XhasD[m, d], b = True; Break[]]]; If[b, Break[]]]; Sow[a]]][[2, 1]] (* Jean-François Alcover, Jul 31 2015, after Harry J. Smith *)
PROG
(PARI) XhasD(x, d)= { local(f); while (x>9, f=x-10*(x\10); if (f==d, return(1)); x\=10); return(x==d) } { for (n=0, 2000, for (m=n + 1, 10*n + 10, a=m; b=0; for (d=0, 9, if (XhasD(n, d) && XhasD(m, d), b=true; break)); if (b, break) ); write("b063660.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 27 2009
(Haskell)
import Data.List (intersect)
a063660 n = head [m | m <- [n + 1 ..],
not $ null $ show m `intersect` show n]
-- Reinhard Zumkeller, Jan 15 2013
CROSSREFS
Sequence in context: A377565 A111381 A369604 * A354049 A354113 A354114
KEYWORD
easy,nonn,base
AUTHOR
Reinhard Zumkeller, Jul 25 2001
STATUS
approved