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.

Showing 1-9 of 9 results.

A028864 Primes with digits in nondecreasing order.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

Identical digits are acceptable, e.g., 1117 is in the sequence. - Harvey P. Dale, Aug 16 2011

Crossrefs

Programs

  • Magma
    [p:p in PrimesUpTo(1200)| Reverse(Intseq(p)) eq Sort(Intseq(p))]; // Marius A. Burtea, Nov 29 2019
    
  • 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 *)
  • PARI
    select(n->n=digits(n); n==vecsort(n), primes(500)) \\ Charles R Greathouse IV, Mar 15 2014
    
  • 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
    A028864_list = list(islice(A028864_gen(),30)) # Chai Wah Wu, Dec 25 2023
  • 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)
    } //  Christian N. K. Anderson, Apr 04 2013
    

Formula

Trivially, a(n) >> exp(n^(1/10)). - Charles R Greathouse IV, Mar 15 2014
prime(n) = A028905(n) if prime(n) is in this sequence. - Alonso del Arte, Nov 25 2019

Extensions

Definition corrected by Omar E. Pol, Mar 22 2012

A052015 Primes with distinct digits in ascending order.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 37, 47, 59, 67, 79, 89, 127, 137, 139, 149, 157, 167, 179, 239, 257, 269, 347, 349, 359, 367, 379, 389, 457, 467, 479, 569, 1237, 1249, 1259, 1279, 1289, 1367, 1459, 1489, 1567, 1579, 1789, 2347, 2357, 2389, 2459, 2467, 2579
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Examples

			Last term is a(100) = 23456789.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) `if`(isprime(n), n, [][]), seq(
          b(parse(cat(n, j))), j=irem(n, 10)+1..9)
        end:
    sort([seq(b(n), n=1..9)])[];  # Alois P. Heinz, Jun 16 2025
  • Mathematica
    t={};Do[p=Prime[n];If[Select[Differences[IntegerDigits[p]],#<=0&]=={},AppendTo[t,p]],{n,380}];t (* Jayanta Basu, May 04 2013 *)
    Select[Prime[Range[5000]],Min[Differences[IntegerDigits[#]]]>0&] (* Harvey P. Dale, Jun 20 2015 *)
    Select[FromDigits@# &/@Subsets@Range@9,PrimeQ] (* Hans Rudolf Widmer, Apr 08 2023 *)
  • PARI
    A052015=vecextract( vecsort( vector( 511,i,isprime( t=eval( concat( vecextract(Vec("123456789"),i ))))*t),NULL,8),"^1") /* for old PARI versions replace,NULL,8),"^1" by ),"-100.." */ \\ M. F. Hasler, Jan 27 2009
    
  • Python
    from sympy import isprime
    from itertools import combinations
    def agen(): # generator of terms
        for d in range(1, 9):
            for c in combinations("123456789", d):
                if isprime(t:=int("".join(c))):
                    yield t
    print(list(agen())) # Michael S. Branicky, Dec 13 2023

A028867 Primes with digits in nonincreasing order.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 41, 43, 53, 61, 71, 73, 83, 97, 211, 311, 331, 421, 431, 433, 443, 521, 541, 631, 641, 643, 653, 661, 733, 743, 751, 761, 773, 811, 821, 853, 863, 877, 881, 883, 887, 911, 941, 953, 971, 977, 983, 991, 997, 2111, 2221, 3221
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    t={};Do[p=Prime[n];If[Select[Differences[IntegerDigits[p]],#>0&]=={},AppendTo[t,p]],{n,460}];t (* Jayanta Basu, May 04 2013 *)
    Select[Prime[Range[600]],Max[Differences[IntegerDigits[#]]]<1&] (* Harvey P. Dale, Oct 30 2013 *)
  • 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
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy import isprime
    def A028867_gen(): # generator of terms
        yield from (2,3,5,7)
        a, b = {'1':1,'2':1,'3':2,'4':2,'5':2,'6':2,'7':3,'8':3,'9':4}, (1,3,7,9)
        for l in count(1):
            mlist = []
            for d in combinations_with_replacement('987654321',l):
                k = 10*int(''.join(d))
                for e in b[:a[d[-1]]]:
                    if isprime(m:=k+e):
                        mlist.append(m)
            yield from sorted(mlist)
    A028867_list = list(islice(A028867_gen(),30)) # Chai Wah Wu, Dec 25 2023

Extensions

Definition corrected by Omar E. Pol, Mar 22 2012

A190219 Numbers all of whose divisors have decimal digits in strictly decreasing order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 21, 31, 40, 41, 43, 53, 61, 62, 63, 71, 73, 82, 83, 86, 93, 97, 421, 431, 521, 541, 631, 641, 643, 653, 743, 751, 761, 821, 842, 853, 862, 863, 941, 953, 961, 971, 983, 5431, 6421, 6521, 7321, 7541, 7621, 7643, 8431, 8521
Offset: 1

Views

Author

Jaroslav Krizek, May 06 2011

Keywords

Comments

Sequence is finite. Last term a(104) = 98765431.
Subset of A009995 and A190220. Superset of A052014.

Examples

			Number 93 is in sequence because all divisors of 93 (1, 3, 31, 93) are numbers whose decimal digits are in strictly decreasing order.
		

Programs

  • Maple
    with(numtheory): A190219 := proc(n) option remember: local d,dd,i,j,k,m,poten: if(n=1)then return 1: fi: for k from procname(n-1)+1 do d:=divisors(k): poten:=1: for i from 1 to nops(d) do m:=-1: dd:=convert(d[i],base,10): for j from 1 to nops(dd) do if(mA190219(n),n=1..60); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Select[Range[9000],Max[Flatten[Differences/@(IntegerDigits/@Divisors[#])]]<0&] (* Harvey P. Dale, Feb 22 2024 *)

A061245 Prime numbers with odd digits in descending order.

Original entry on oeis.org

3, 5, 7, 11, 31, 53, 71, 73, 97, 311, 331, 733, 751, 773, 911, 953, 971, 977, 991, 997, 3331, 5333, 5531, 7331, 7333, 7753, 9311, 9511, 9533, 9551, 9733, 9931, 9973, 33311, 33331, 55331, 55333, 55511, 73331, 75511, 75533, 75553, 77551, 77711
Offset: 1

Views

Author

Amarnath Murthy, Apr 23 2001

Keywords

Crossrefs

Extensions

More terms from Patrick De Geest, Jun 04 2001

A212372 Nonprime numbers with distinct digits in descending order.

Original entry on oeis.org

1, 4, 6, 8, 9, 10, 20, 21, 30, 32, 40, 42, 50, 51, 52, 54, 60, 62, 63, 64, 65, 70, 72, 74, 75, 76, 80, 81, 82, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 98, 210, 310, 320, 321, 410, 420, 430, 432, 510, 520, 530, 531, 532, 540, 542, 543, 610, 620, 621, 630
Offset: 1

Views

Author

Jaroslav Krizek, May 10 2012

Keywords

Comments

Sequence is finite with 935 terms, last term is a(935) = 9876543210.
Complement of A052014 with respect to A009995.

Crossrefs

Cf. A052014 (primes with distinct digits in descending order), A009995 (numbers with distinct digits in descending order).

Formula

A178788(a(n)) = 1.

A381158 Prime numbers where digit values decrease while alternating parity.

Original entry on oeis.org

2, 3, 5, 7, 41, 43, 61, 83, 521, 541, 743, 761, 941, 983, 6521, 8521, 8543, 8741, 8761, 76541, 76543, 94321, 98321, 98543
Offset: 1

Views

Author

James S. DeArmon, Feb 15 2025

Keywords

Examples

			41 is a term, since the digits decrease in value and alternate even and odd.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) `if`(isprime(n), n, [][]), seq(b(10*n+j), j=irem(n, 10)-1..1, -2) end:
    {seq(b(n), n=1..9)}[];  # Alois P. Heinz, Mar 12 2025
  • Mathematica
    ad=Select[Prime[Range[10^6]],Reverse[Union[IntegerDigits[#]]]==IntegerDigits[#]&];fQ[n_] := Block[{m = Mod[ IntegerDigits@ n, 2]}, m == Split[m, UnsameQ][[1]]];Select[ad,fQ] (* James C. McMahon, Mar 20 2025 *)
  • Python
    from sympy import isprime
    from itertools import combinations
    def ap(s): return all((s[i] in "13579") == (s[i+1] in "02468") for i in range(len(s)-1))
    def afull(): return sorted(t for d in range(1, 10) for c in combinations("987654321", d) if ap(c) and isprime(t:=int("".join(c))))
    print(afull()) # Michael S. Branicky, Mar 10 2025

A155768 Indices of primes with digits in strictly decreasing order.

Original entry on oeis.org

1, 2, 3, 4, 11, 13, 14, 16, 18, 20, 21, 23, 25, 82, 83, 98, 100, 115, 116, 117, 119, 132, 133, 135, 142, 147, 150, 160, 162, 164, 166, 717, 835, 843, 933, 956, 968, 970, 1055, 1062, 1066, 1076, 1088, 1090, 1092, 1093, 1166, 1167, 1179, 1190, 1191, 1199, 1202
Offset: 1

Views

Author

Zak Seidov, Jan 27 2009

Keywords

Comments

Indices of primes in A052014.
There are exactly 87 terms: 1,2,3,4,11,13,14,16,18,20,21,23,25,82,83,98,100,115,116,117,119,132,133,135,142,147,150,160,162,164,166,717,835,843,933,956,968,970,1055,1062,1066,1076,1088,1090,1092,1093,1166,1167,1179,1190,1191,1199,1202,1215,1218,7433,7518,7530,7531,8414,8486,8498,8509,8510,8511,9096,9286,9391,9441,9463,9468,9471,9479,61307,68743,69564,76755,77533,77608,77614,587773,587837,649440,656917,5634190,5694444,5694505

Crossrefs

Programs

  • Mathematica
    Select[Range[1300],And@@Negative[Differences[IntegerDigits[Prime[#]]]]&] (* Harvey P. Dale, Nov 24 2011 *)

A261511 Twin primes with both terms having distinct digits in descending order.

Original entry on oeis.org

3, 5, 7, 41, 43, 71, 73, 641, 643, 76541, 76543, 87641, 87643
Offset: 1

Views

Author

Paolo Omodei-Zorini, Aug 22 2015

Keywords

Comments

Numbers in this list are the pairs of twin primes listed in A052014 with both terms having distinct digits in descending order

Crossrefs

Programs

  • Mathematica
    dsc[n_] := 0 > Max@ Differences@ IntegerDigits@n; Union@ Flatten@ Select[ Partition[ Prime@ Range@ 9000, 2, 1], #[[2]] - #[[1]] == 2 && And @@ dsc /@ # &] (* Giovanni Resta, Aug 26 2015 *)
  • PARI
    lista(nn=100000) = {v = []; forprime(p=2, nn, if (isprime(p+2) && (d=digits(p)) && (vecsort(d,,12)==d) && (dd=digits(p+2)) && (vecsort(dd,,12)==dd), v = concat(v, p); v = concat(v,p+2));); vecsort(v,,8);} \\ Michel Marcus, Aug 23 2015
Showing 1-9 of 9 results.