A107814 a(1) = prime(14), for n >= 2, a(n) is the smallest prime not previously used which contains a digit from a(n-1).
43, 3, 13, 11, 17, 7, 37, 23, 2, 29, 19, 31, 41, 47, 67, 61, 71, 73, 53, 5, 59, 79, 89, 83, 103, 101, 107, 97, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A107353.
Programs
-
Maple
Cands:= subsop(14=NULL, [seq(ithprime(i),i=1..1000)]): S:= map(t -> convert(convert(t,base,10),set), Cands): R:= 43: x:= 43: xs:= {3,4}: for n from 2 to 100 do found:= false; for i from 1 do if S[i] intersect xs <> {} then R:= R, Cands[i]; x:= Cands[i]; xs:= S[i]; Cands:= subsop(i=NULL,Cands); S:= subsop(i=NULL,S); found:= true; break fi od; if not found then break fi; od: R; # Robert Israel, Dec 16 2024
-
Mathematica
p=Prime[14];b={p};d=p;Do[Do[r=Prime[c];If[FreeQ[b, r]&&Intersection@@IntegerDigits/@{d, r}=!={}, b=Append[b, r];d=r;Break[]], {c, 1000}], {k, 60}];b
Formula
a(n) ~ n log n. - Charles R Greathouse IV, Jul 20 2011
Comments