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.

A028867 Primes with digits in nonincreasing order.

This page as a plain text file.
%I A028867 #27 Dec 26 2023 06:41:22
%S A028867 2,3,5,7,11,31,41,43,53,61,71,73,83,97,211,311,331,421,431,433,443,
%T A028867 521,541,631,641,643,653,661,733,743,751,761,773,811,821,853,863,877,
%U A028867 881,883,887,911,941,953,971,977,983,991,997,2111,2221,3221
%N A028867 Primes with digits in nonincreasing order.
%H A028867 Alois P. Heinz, <a href="/A028867/b028867.txt">Table of n, a(n) for n = 1..10000</a> (terms n = 1..1000 from T. D. Noe)
%t A028867 t={};Do[p=Prime[n];If[Select[Differences[IntegerDigits[p]],#>0&]=={},AppendTo[t,p]],{n,460}];t (* _Jayanta Basu_, May 04 2013 *)
%t A028867 Select[Prime[Range[600]],Max[Differences[IntegerDigits[#]]]<1&] (* _Harvey P. Dale_, Oct 30 2013 *)
%o A028867 (PARI) is(n)=my(d=digits(n)); for(i=2,#d,if(d[i]>d[i-1],return(0))); isprime(n) \\ _Charles R Greathouse IV_, Aug 18 2017
%o A028867 (Python)
%o A028867 from itertools import count, islice, combinations_with_replacement
%o A028867 from sympy import isprime
%o A028867 def A028867_gen(): # generator of terms
%o A028867     yield from (2,3,5,7)
%o A028867     a, b = {'1':1,'2':1,'3':2,'4':2,'5':2,'6':2,'7':3,'8':3,'9':4}, (1,3,7,9)
%o A028867     for l in count(1):
%o A028867         mlist = []
%o A028867         for d in combinations_with_replacement('987654321',l):
%o A028867             k = 10*int(''.join(d))
%o A028867             for e in b[:a[d[-1]]]:
%o A028867                 if isprime(m:=k+e):
%o A028867                     mlist.append(m)
%o A028867         yield from sorted(mlist)
%o A028867 A028867_list = list(islice(A028867_gen(),30)) # _Chai Wah Wu_, Dec 25 2023
%Y A028867 Cf. A052014, A028864, A052015.
%K A028867 nonn,base
%O A028867 1,1
%A A028867 _Patrick De Geest_
%E A028867 Definition corrected by _Omar E. Pol_, Mar 22 2012