OFFSET
1,1
MATHEMATICA
ta={1}; Do[s1=IntegerDigits[Part[ta, Length[ta]]]; s2=IntegerDigits[n]; If[Equal[Intersection[s1, s2], {}] &&!PrimeQ[n], Print[{Last[ta], n}]; ta=Append[ta, n]], {n, 1, 1000000}]; ta=Delete[ta, 1]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Labos Elemer, Dec 01 2004
STATUS
approved