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-10 of 12 results. Next

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

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

A052014 Primes with distinct digits in descending order.

Original entry on oeis.org

2, 3, 5, 7, 31, 41, 43, 53, 61, 71, 73, 83, 97, 421, 431, 521, 541, 631, 641, 643, 653, 743, 751, 761, 821, 853, 863, 941, 953, 971, 983, 5431, 6421, 6521, 7321, 7541, 7621, 7643, 8431, 8521, 8543, 8641, 8731, 8741, 8753, 8761, 9421, 9431, 9521, 9631, 9643
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Comments

Last term is a(87) = 98765431.

Crossrefs

Programs

  • Maple
    b:= proc(n) `if`(isprime(n), n, [][]), seq(
          b(parse(cat(n, j))), j=1..irem(n, 10)-1)
        end:
    sort([seq(b(n), n=1..9)])[];  # Alois P. Heinz, Jun 16 2025
  • Mathematica
    Select[Prime[Range[1200]], Max[DigitCount[#]] == 1 && And@@Negative[ Differences[IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 22 2011 *)
    t={}; Do[p=Prime[n]; If[Select[Differences[IntegerDigits[p]], # >= 0&] == {}, AppendTo[t,p]], {n,1195}]; t (* Jayanta Basu, May 04 2013 *)
  • PARI
    A052014=[]; for( i=1,1023, c=-1; isprime( t=sum( j=0,9, if(bittest(i,j),j*10^c++))) & A052014=concat(A052014,t)); A052014=vecsort(A052014)

A071363 Largest n-digit prime with strictly increasing digits.

Original entry on oeis.org

7, 89, 569, 5689, 34679, 345689, 1456789, 23456789
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Comments

Notice the terms with consecutive digits; search for 23456789 to find several related sequences including A006055, A052017 and A052077.

Examples

			a(1) = A052015(4), a(2) = A052015(15), a(3) = A052015(35), a(4) = A052015(61), ... In short, a(n) = A052015(b(n)) with b = (4, 15, 35, 61, 81, 94, 98, 100). - _M. F. Hasler_, May 03 2017
		

Crossrefs

Subsequence of A052015.

Programs

  • PARI
    A071363(n,u=vectorv(n,i,10^(n-i)))={forvec(d=vector(n,i,[1,9]),isprime(d*u)&&n=d*u,2);n} \\ M. F. Hasler, May 03 2017

A155763 Indices of primes with digits in strictly increasing order.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 15, 17, 19, 22, 24, 31, 33, 34, 35, 37, 39, 41, 52, 55, 57, 69, 70, 72, 73, 75, 77, 88, 91, 92, 104, 203, 204, 205, 207, 209, 219, 232, 237, 247, 249, 278, 348, 350, 355, 364, 365, 376, 391, 405, 483, 486, 487, 619, 633, 644, 749, 1475
Offset: 1

Views

Author

Zak Seidov, Jan 27 2009

Keywords

Comments

Indices of primes in A052015.
There are exactly 100 terms: 1,2,3,4,6,7,8,9,10,12,15,17,19,22,24,31,33,34,35,37,39,41,52,55,57,69,70,72,73,75,77,88,91,92,104,203,204,205,207,209,219,232,237,247,249,278,348,350,355,364,365,376,391,405,483,486,487,619,633,644,749,1475,1478,1487,1489,1501,1504,1515,1595,1597,1605,1615,1631,1830,2611,2622,2637,2646,2829,3694,3704,11602,11603,11699,11706,11803,12560,13479,20797,20884,20891,21698,29629,29630,95375,95443,96140,111119,809912,1475171.

Crossrefs

Programs

  • Mathematica
    Select[Range[1500],Min[Differences[IntegerDigits[Prime[#]]]]>0&] (* Harvey P. Dale, Feb 27 2017 *)

A190218 Numbers all of whose divisors are numbers whose decimal digits are in strictly increasing order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89, 125, 127, 134, 135, 136, 137, 138, 139, 145, 149, 157, 158, 167, 169, 178, 179, 235
Offset: 1

Views

Author

Jaroslav Krizek, May 06 2011

Keywords

Comments

Sequence is finite. Last term a(163) = 23456789.
Subset of A009993. Superset of A052015.

Examples

			Number 135 is in sequence because all divisors of 135 (1, 3, 5, 9, 15, 27, 45, 135) are numbers whose decimal digits are in strictly increasing order.
		

Programs

  • Maple
    with(numtheory): A190218 := 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:=10: dd:=convert(d[i], base, 10): for j from 1 to nops(dd) do if(m>dd[j])then m:=dd[j]: else poten:=0: break: fi: od: if(poten=0)then break:fi: od: if(poten=1)then return k: fi: od: end: seq(A190218(n), n=1..62); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Select[Range[250], And@@Positive[Flatten[Differences/@(IntegerDigits/@Divisors[#])]]&] (* Harvey P. Dale, Mar 24 2012 *)

A061244 Prime numbers with odd digits in ascending order.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 37, 59, 79, 113, 137, 139, 157, 179, 199, 337, 359, 379, 557, 577, 599, 1117, 1399, 1559, 1579, 1777, 1999, 3359, 3557, 3559, 3779, 5557, 5779, 11113, 11117, 11119, 11159, 11177, 11399, 11579, 11777, 11779, 13337, 13339
Offset: 1

Views

Author

Amarnath Murthy, Apr 23 2001

Keywords

Examples

			37 is a term since 3 and 7 are odd digits and 3 < 7.
		

Crossrefs

Programs

  • Maple
    A061244:= {}:
    for d from 1 to 20 do
      for n1 from 0 to d do
        x1:= (10^n1-1)/9;
        for n3 from 0 to d-n1 do
          x3:= x1*10^n3 + (10^n3-1)/9*3;
          for n5 from 0 to d-n1-n3 do
            x5:= x3*10^n5 + (10^n5-1)/9*5;
            for n7 from 0 to d-n1-n3-n5 do
              x7:= x5*10^n7 + (10^n7-1)/9*7;
              n9:= d-n1-n3-n5-n7;
              x:= x7*10^n9 + (10^n9-1);
              if isprime(x) then
                A061244:= A061244 union {x};
              fi
    od od od od od:
    A061244;
    # Robert Israel, Apr 20 2014

Extensions

More terms from Patrick De Geest, Jun 04 2001

A211771 Nonprime numbers with distinct digits in ascending order.

Original entry on oeis.org

1, 4, 6, 8, 9, 12, 14, 15, 16, 18, 24, 25, 26, 27, 28, 34, 35, 36, 38, 39, 45, 46, 48, 49, 56, 57, 58, 68, 69, 78, 123, 124, 125, 126, 128, 129, 134, 135, 136, 138, 145, 146, 147, 148, 156, 158, 159, 168, 169, 178, 189, 234, 235, 236, 237, 238, 245, 246, 247
Offset: 1

Views

Author

Jaroslav Krizek, May 07 2012

Keywords

Comments

Sequence is finite with 411 terms, last term is a(411) = 123456789.
Complement of A052015 with respect to A009993. Supersequence of A211772.

Crossrefs

Cf. A052015 (primes with distinct digits in ascending order), A009993 (numbers with distinct digits in ascending order), A211772 (nonprime numbers all of whose divisors are numbers whose decimal digits are in ascending order).

Programs

  • Mathematica
    nnddQ[n_]:=!PrimeQ[n]&&Max[DigitCount[n]]<2&&Min[Differences[ IntegerDigits[ n]]]>0; Select[Range[300],nnddQ] (* Harvey P. Dale, Sep 27 2020 *)

Formula

A178788(a(n)) = 1.

A211772 Nonprime numbers all of whose divisors are numbers whose decimal digits are in ascending order.

Original entry on oeis.org

1, 4, 6, 8, 9, 12, 14, 15, 16, 18, 24, 25, 26, 27, 28, 34, 35, 36, 38, 39, 45, 46, 48, 49, 56, 57, 58, 68, 69, 78, 125, 134, 135, 136, 138, 145, 158, 169, 178, 235, 237, 245, 247, 259, 267, 268, 278, 289, 356, 358, 469, 478, 578, 1345, 1357, 1369, 2479, 2569
Offset: 1

Views

Author

Jaroslav Krizek, May 07 2012

Keywords

Comments

Sequence is finite with 63 terms, last term is a(63) = 134689.
Complement of A052015 with respect to A190218. Subsequence of A211771.

Examples

			Divisors of 24589: 1, 67, 367, 24589 (all divisors with digits in ascending order).
		

Crossrefs

Cf. A052015 (primes with distinct digits in ascending order), A190218 (numbers all of whose divisors are numbers whose decimal digits are in ascending order), A211771 (nonprime numbers with distinct digits in ascending order).

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
Showing 1-10 of 12 results. Next