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.

A028864 Primes with digits in nondecreasing order.

This page as a plain text file.
%I A028864 #42 Dec 26 2023 06:42:23
%S A028864 2,3,5,7,11,13,17,19,23,29,37,47,59,67,79,89,113,127,137,139,149,157,
%T A028864 167,179,199,223,227,229,233,239,257,269,277,337,347,349,359,367,379,
%U A028864 389,449,457,467,479,499,557,569,577,599,677,1117,1123,1129
%N A028864 Primes with digits in nondecreasing order.
%C A028864 Identical digits are acceptable, e.g., 1117 is in the sequence. - _Harvey P. Dale_, Aug 16 2011
%H A028864 Alois P. Heinz, <a href="/A028864/b028864.txt">Table of n, a(n) for n = 1..10000</a> (terms n = 1..1000 from T. D. Noe)
%F A028864 Trivially, a(n) >> exp(n^(1/10)). - _Charles R Greathouse IV_, Mar 15 2014
%F A028864 prime(n) = A028905(n) if prime(n) is in this sequence. - _Alonso del Arte_, Nov 25 2019
%t A028864 daoQ[n_] := Count[Differences[IntegerDigits[n]], _?(# < 0 &)] == 0; Select[Prime[Range[200]], daoQ] (* _Harvey P. Dale_, Aug 16 2011 *)
%t A028864 Select[Prime[Range[200]],Min[Differences[IntegerDigits[#]]]>-1&] (* _Harvey P. Dale_, Mar 02 2023 *)
%o A028864 (R) j=2; y=as.bigz(c()); while(j<1000) {
%o A028864 x=sort(as.numeric(strsplit(as.character(j),spl="")[[1]]),decr=F)
%o A028864 if(j==paste(x[x>0],collapse="")) y=c(y,j)
%o A028864 j=nextprime(j)
%o A028864 } //  _Christian N. K. Anderson_, Apr 04 2013
%o A028864 (PARI) select(n->n=digits(n); n==vecsort(n), primes(500)) \\ _Charles R Greathouse IV_, Mar 15 2014
%o A028864 (Magma) [p:p in PrimesUpTo(1200)| Reverse(Intseq(p)) eq Sort(Intseq(p))]; // _Marius A. Burtea_, Nov 29 2019
%o A028864 (Python)
%o A028864 from itertools import count, islice, combinations_with_replacement
%o A028864 from sympy import isprime
%o A028864 def A028864_gen(): # generator of terms
%o A028864     yield from (2,3,5,7)
%o A028864     a, b = {'1':0,'2':1,'3':1,'4':2,'5':2,'6':2,'7':2,'8':3,'9':3}, (1,3,7,9)
%o A028864     for l in count(1):
%o A028864         for d in combinations_with_replacement('123456789',l):
%o A028864             k = 10*int(''.join(d))
%o A028864             for e in b[a[d[-1]]:]:
%o A028864                 if isprime(m:=k+e):
%o A028864                     yield m
%o A028864 A028864_list = list(islice(A028864_gen(),30)) # _Chai Wah Wu_, Dec 25 2023
%Y A028864 Cf. A009994, A052015, A028867, A052014, A028905.
%K A028864 nonn,base,nice
%O A028864 1,1
%A A028864 _Patrick De Geest_
%E A028864 Definition corrected by _Omar E. Pol_, Mar 22 2012