login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A129845 Numbers n such that n and 2n share at least one digit. 8

%I #21 Apr 17 2014 02:59:03

%S 10,12,20,21,24,25,26,30,37,40,42,47,49,50,51,60,61,62,63,68,70,71,74,

%T 75,80,81,84,87,89,90,91,95,96,97,98,99,100,101,102,103,104,105,106,

%U 107,108,109,110,112,120,121,122,123,124,125,126,127,128,129,130,132,137

%N Numbers n such that n and 2n share at least one digit.

%C The smallest term sharing more than one digit with its double is 102. - _Alonso del Arte_, Apr 16 2014

%H Reinhard Zumkeller, <a href="/A129845/b129845.txt">Table of n, a(n) for n = 1..10000</a>

%e 10 is in the sequence because 2 * 10 = 20, which has a 0 in common with 10.

%e 12 is in the sequence because 2 * 12 = 24, which has a 2 in common with 12.

%e 14 is not in the sequence because 2 * 14 = 28, which has no digits in common with 14.

%p a:=proc(n) if nops(convert(convert(n,base,10),set) intersect convert(convert(2*n,base,10),set))>0 then n else fi end: seq(a(n),n=1..170); # _Emeric Deutsch_, May 27 2007

%p isA129845 := proc(n) local twon,digsn,digs2n,i ; twon := 2*n ; digsn := convert(n,base,10) ; digs2n := convert(twon,base,10) ; for i from 1 to nops(digsn) do if op(i,digsn) in digs2n then RETURN(true) ; fi ; od ; RETURN(false) ; end: for n from 1 to 200 do if isA129845(n) then printf("%d, ",n) ; fi ; od ; # _R. J. Mathar_, Jun 08 2007

%t Select[Range[300], Length[Intersection[IntegerDigits[#], IntegerDigits[2#]]] > 0 &] (* _Stefan Steinerberger_, May 24 2007 *)

%o (Haskell)

%o a129845 n = a129845_list !! (n-1)

%o a129845_list =

%o filter (\x -> not $ null (show (2*x) `intersect` show x)) [1..]

%o -- _Reinhard Zumkeller_, Aug 16 2011

%Y Cf. A038365 (complement).

%K base,easy,nonn

%O 1,1

%A _Eric Angelini_, May 22 2007

%E More terms from _R. J. Mathar_, _Stefan Steinerberger_ and _Emeric Deutsch_, May 24 2007

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 18 10:00 EDT 2024. Contains 374378 sequences. (Running on oeis4.)