A177119 Primes whose digits can be arranged as consecutive digits (more precisely, to form a substring of 0123456789).
2, 3, 5, 7, 23, 43, 67, 89, 1423, 2143, 2341, 2543, 4231, 4253, 4523, 4567, 4657, 5647, 5867, 6547, 6857, 10243, 12043, 20143, 20341, 20431, 23041, 24103, 25463, 25643, 30241, 32401, 36457, 40123, 40213, 40231, 41023, 41203, 42013, 43201, 45263, 45673, 45763
Offset: 1
Examples
a(12)=2543 can be arranged as 2345. 109 is not a term since 019 is not a substring of 0123456789.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..6744 (full sequence)
- G. L. Honaker, Jr. and Chris Caldwell, Prime Curios! 2543
Crossrefs
Programs
-
Maple
A177119:={}: for d from 1 to 5 do for s from 0 to 10-d do l:=combinat[permute]([$(s..(s+d-1))]): for k from 1 to d! do n:=add(10^(d-j)*l[k][j],j=1..d): if(isprime(n))then A177119 := A177119 union {n}: fi: od: od: od: op(A177119); # Nathaniel Johnston, Jun 23 2011
-
Mathematica
(* computes all terms *) Reap[Do[p=Prime[n]; If[p<10 || Union[Differences[Sort[IntegerDigits[p]]]] == {1}, Sow[p]], {n, PrimePi[98765432]}]][[2, 1]] (* T. D. Noe, Dec 10 2010 *) lst = {}; Do[AppendTo[lst, Select[FromDigits /@ Permutations@Range[n, d + n - 1], PrimeQ[#] &]], {d, 5}, {n, 0, 10 - d}]; Union@Flatten[lst] (* Arkadiusz Wesolowski, Jan 07 2013 *) Join[{2,3,5,7},Select[Prime[Range[57*10^5]],Union[Differences[Sort[IntegerDigits[#]]]]=={1}&]] (* Harvey P. Dale, Jun 20 2023 *)
Extensions
Extended by Chris K. Caldwell
Edited by N. J. A. Sloane, Jan 22 2011
Comments