|
|
A028864
|
|
Primes with digits in nondecreasing order.
|
|
17
|
|
|
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 47, 59, 67, 79, 89, 113, 127, 137, 139, 149, 157, 167, 179, 199, 223, 227, 229, 233, 239, 257, 269, 277, 337, 347, 349, 359, 367, 379, 389, 449, 457, 467, 479, 499, 557, 569, 577, 599, 677, 1117, 1123, 1129
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Identical digits are acceptable, e.g., 1117 is in the sequence. - Harvey P. Dale, Aug 16 2011
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
daoQ[n_] := Count[Differences[IntegerDigits[n]], _?(# < 0 &)] == 0; Select[Prime[Range[200]], daoQ] (* Harvey P. Dale, Aug 16 2011 *)
Select[Prime[Range[200]], Min[Differences[IntegerDigits[#]]]>-1&] (* Harvey P. Dale, Mar 02 2023 *)
|
|
PROG
|
(R) j=2; y=as.bigz(c()); while(j<1000) {
x=sort(as.numeric(strsplit(as.character(j), spl="")[[1]]), decr=F)
if(j==paste(x[x>0], collapse="")) y=c(y, j)
j=nextprime(j)
(Magma) [p:p in PrimesUpTo(1200)| Reverse(Intseq(p)) eq Sort(Intseq(p))]; // Marius A. Burtea, Nov 29 2019
(Python)
from itertools import count, islice, combinations_with_replacement
from sympy import isprime
def A028864_gen(): # generator of terms
yield from (2, 3, 5, 7)
a, b = {'1':0, '2':1, '3':1, '4':2, '5':2, '6':2, '7':2, '8':3, '9':3}, (1, 3, 7, 9)
for l in count(1):
for d in combinations_with_replacement('123456789', l):
k = 10*int(''.join(d))
for e in b[a[d[-1]]:]:
if isprime(m:=k+e):
yield m
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|