%I #32 Apr 11 2018 08:36:04
%S 2,3,5,7,11,23,41,53,61,73,89,101,223,401,523,601,727,809,1117,2003,
%T 4111,5003,6121,7039,8111,9007,11113,20029,31147,50069,71143,80209,
%U 111143,200009,311111,400009,511111,600043,711121,800053,911111,2000003,4111147,5000263,7111199,8000023,9111161
%N a(n) is the least prime > a(n-1) whose digits do not appear in a(n-1).
%C Sequence is infinite. - _T. D. Noe_, Jun 06 2007
%C a(n) may never have all of the 4 digits 1, 3, 7, 9: if a(n) has 3 of these digits then a(n+1) ends with the fourth one. - _Pierre CAMI_, May 06 2011
%H T. D. Noe, <a href="/A030284/b030284.txt">Table of n, a(n) for n = 1..500</a>
%t ta={1};Do[s1=IntegerDigits[Part[ta, Length[ta]]]; s2=IntegerDigits[Prime[n]];If[Equal[Intersection[s1, s2], {}], Print[{Prime[n], Prime[n+1]}];ta=Append[ta, Prime[n]]], {n, 1, 1000000}];ta=Delete[ta, 1] (* _Labos Elemer_, Nov 18 2004 *)
%o (Haskell)
%o import Data.List (intersect)
%o a030284 n = a030284_list !! (n-1)
%o a030284_list = f [] a000040_list where
%o f xs (p:ps) = if null $ intersect xs ys then p : f ys ps else f xs ps
%o where ys = show p
%o -- _Reinhard Zumkeller_, Sep 21 2013
%Y Cf. A030283, A229364, A000040.
%K nonn,base
%O 1,1
%A _Patrick De Geest_
%E More terms from _Labos Elemer_, Nov 18 2004
|