A249953 Primes with distinct digits: a(n) is the least prime > a(n-1) such that a(n-1) and a(n) share just one digit.
13, 17, 19, 29, 59, 79, 89, 97, 107, 139, 157, 163, 179, 239, 241, 257, 263, 271, 283, 307, 349, 367, 389, 409, 421, 439, 457, 461, 479, 509, 521, 547, 563, 571, 593, 613, 647, 653, 691, 701, 739, 751, 769, 809, 821, 839, 857, 863, 937, 941, 953, 967, 983, 1049, 1237, 1409, 1523, 1607
Offset: 1
Links
- Zak Seidov, Table of n, a(n) for n = 1..163
Programs
-
Mathematica
a249953[n_Integer] := Module[{t = {1}, i}, Do[If[And[DuplicateFreeQ[IntegerDigits[Prime[i]]], Length[Intersection[IntegerDigits[Last@t], IntegerDigits[Prime[i]]]] == 1], True; t = Append[t, Prime[i]]], {i, 1, n}]; Rest[t]]; a249953[120000] (* Michael De Vlieger, Dec 14 2014 *) lp1d[n_]:=Module[{p=NextPrime[n]},While[Length[Intersection[ IntegerDigits[ n],IntegerDigits[p]]]!=1||!DuplicateFreeQ[ IntegerDigits[ p]],p= NextPrime[ p]];p]; NestList[lp1d,13,60] (* Harvey P. Dale, May 31 2019 *)
Comments