cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A177119 Primes whose digits can be arranged as consecutive digits (more precisely, to form a substring of 0123456789).

Original entry on oeis.org

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

Views

Author

G. L. Honaker, Jr., Dec 09 2010

Keywords

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

Examples

			a(12)=2543 can be arranged as 2345.
109 is not a term since 019 is not a substring of 0123456789.
		

Crossrefs

Cf. A000040, A001477, A156119. See A068710 for a different (and presumably infinite) version.

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