login
A177119
Primes whose digits can be arranged as consecutive digits (more precisely, to form a substring of 0123456789).
3
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,1
COMMENTS
These are the primes whose digits can be permuted to give a substring of 0123456789.
This sequence has exactly 6744 terms, none of which are 3-digit, 6-digit, 9-digit, or 10-digit numbers because these are all divisible by 3. The last term is 98745623. - Chris K. Caldwell
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..6744 (full sequence)
G. L. Honaker, Jr. and Chris Caldwell, Prime Curios! 2543
EXAMPLE
a(12)=2543 can be arranged as 2345.
109 is not a term since 019 is not a substring of 0123456789.
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 *)
CROSSREFS
Cf. A000040, A001477, A156119. See A068710 for a different (and presumably infinite) version.
Sequence in context: A059170 A068710 A120805 * A096265 A356271 A056041
KEYWORD
nonn,easy,fini,full,base
AUTHOR
G. L. Honaker, Jr., Dec 09 2010
EXTENSIONS
Extended by Chris K. Caldwell
Edited by N. J. A. Sloane, Jan 22 2011
STATUS
approved