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

Numbers n such that n and prime(n) have no common digits.
3

%I #16 Aug 11 2023 11:18:14

%S 1,2,3,4,5,6,8,9,10,12,15,16,17,19,20,21,22,24,25,26,27,28,35,36,39,

%T 40,42,43,44,45,46,47,48,49,50,51,53,57,58,59,60,61,64,65,66,67,68,69,

%U 70,71,72,76,77,79,85,86,87,88,89,90,91,93,96,98,99,101

%N Numbers n such that n and prime(n) have no common digits.

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

%e 98 is in the sequence because prime(98) = 521, which has no digits in common with 98.

%t Select[Range[110],Intersection[IntegerDigits[#],IntegerDigits[Prime[#]]]=={}&] (* _Harvey P. Dale_, Aug 11 2023 *)

%o (PARI) s=[]; for(n=1, 300, if(setintersect(vecsort(digits(n),,8), vecsort(digits(prime(n)),,8))==[], s=concat(s, n))); s

%o (Haskell)

%o import Data.List (intersect)

%o a243355 n = a243355_list !! (n-1)

%o a243355_list = filter

%o (\x -> null $ show x `intersect` (show $ a000040 x)) [1..]

%o -- _Reinhard Zumkeller_, Sep 14 2014

%Y Cf. A000040, A074350, A119393 (complement).

%K nonn,base,less

%O 1,2

%A _Colin Barker_, Jun 03 2014