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 19 results. Next

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

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)

A211654 Primes that remain prime when their digits are sorted into nondecreasing order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 47, 59, 67, 71, 73, 79, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 173, 179, 193, 197, 199, 223, 227, 229, 233, 239, 257, 269, 271, 277, 293, 307, 311, 317, 337, 347, 349, 359, 367, 373
Offset: 1

Views

Author

Francis J. McDonnell, Apr 17 2012

Keywords

Comments

In sequence A004185 these are referred to as "sortable primes". Nontrivial terms (with digits not in nondecreasing order) are listed in A086042. - M. F. Hasler, Jul 30 2019.

Examples

			173 is prime and after the digits are sorted into nondecreasing order we obtain 137, which is prime.
		

Crossrefs

Cf. A086042 (nontrivial solutions), A004185 (n with digits sorted).

Programs

  • Magma
    [p:p in PrimesUpTo(400)| IsPrime(Seqint(Reverse(Sort(Intseq(p,10)))))]; // Marius A. Burtea, Jul 30 2019
  • Mathematica
    Select[Prime[Range[200]], PrimeQ[FromDigits[Sort[IntegerDigits[#]]]] &] (* T. D. Noe, Apr 17 2012 *)
  • PARI
    select( is_A211654(p)={isprime(fromdigits(vecsort(digits(p))))&&isprime(p)}, primes([1,999])) \\ M. F. Hasler, Jul 30 2019
    

A028905 Arrange digits of primes in ascending order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 13, 37, 14, 34, 47, 35, 59, 16, 67, 17, 37, 79, 38, 89, 79, 11, 13, 17, 19, 113, 127, 113, 137, 139, 149, 115, 157, 136, 167, 137, 179, 118, 119, 139, 179, 199, 112, 223, 227, 229, 233, 239, 124, 125, 257, 236, 269
Offset: 1

Views

Author

Keywords

Comments

Leading zeros are discarded (e.g., 107, rearranged to 017, becomes 17).

Examples

			The digits of 41 are 4, 1, which sorted are 1, 4; those are reinterpreted as 14.
The digits of 43 are 4, 3, which sorted are 3, 4; those are reinterpreted as 34.
The digits of 47 are 4, 7, which are already sorted, so 47 is not changed.
		

Crossrefs

Programs

  • Haskell
    a028905 = a004185 . a000040  -- Reinhard Zumkeller, Apr 03 2015
    
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[Prime[n]]]], {n, 100}] (* Alonso del Arte, Nov 25 2019 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    a(n) = eva(vecsort(digits(prime(n)))) \\ Felix Fröhlich, Nov 25 2019

Formula

a(n) = A004185(A000040(n)). - Reinhard Zumkeller, Apr 03 2015
a(n) = prime(n) if prime(n) is in A028864. - Alonso del Arte, Nov 25 2019

Extensions

More terms from Patrick De Geest, Apr 1998
Offset corrected by Reinhard Zumkeller, Apr 03 2015

A378774 Prime numbers with monotonically increasing digits, increasing by only 0 or 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 67, 89, 223, 233, 677, 1123, 1223, 2333, 4567, 7789, 8999, 23333, 45667, 45677, 55667, 67777, 67789, 77899, 78889, 112223, 344567, 445567, 555677, 556789, 566677, 567899, 666667, 788999, 1112333, 2222333, 3445567, 3445667, 3455567, 3456667, 4455667, 4456789, 4556777
Offset: 1

Views

Author

Randy L. Ekl, Dec 06 2024

Keywords

Examples

			223 is a term since the digits of 223 are monotonically increasing, consecutive digits differ by at most 1, and 223 is prime.
		

Crossrefs

Programs

  • Maple
    extend:= proc(x) local d,s,i;
      d:= ilog10(x);
      s:= floor(x/10^d);
      seq(10^(d+1)*i+x, i=max(1,s-1) .. s)
    end proc:
    R:= 2,3,5,7: count:= 4:
    M:= [1,3,7,9];
    for d from 2 while count < 100 do
      M:= map(extend,M):
      S:= sort(select(isprime,M));
      count:= count+nops(S);
      R:= R,op(S);
    od:
    R; # Robert Israel, Feb 09 2025
  • Mathematica
    Select[Prime[Range[319629]], ContainsOnly[Rest[IntegerDigits[#]]-Drop[IntegerDigits[#], -1], {0, 1}]&] (* James C. McMahon, Dec 21 2024 *)
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p), dd = vector(#d-1, k, d[k+1]-d[k])); (#dd==0) || ((vecmin(dd)>=0) && (vecmax(dd)<=1))); \\ Michel Marcus, Dec 09 2024

A378775 Prime numbers with monotonically decreasing digits, differing by at most 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 43, 211, 433, 443, 877, 887, 2111, 2221, 3221, 5443, 8887, 9887, 22111, 33211, 43321, 54443, 65543, 76543, 98887, 99877, 322111, 332221, 443221, 444443, 766543, 888887, 988877, 2221111, 3221111, 3222211, 3222221, 3333221, 4322221, 4433333, 4443221
Offset: 1

Views

Author

Randy L. Ekl, Dec 06 2024

Keywords

Examples

			211 is a term since 211 is a prime number, the digits of 211 are monotonically decreasing, and the difference between consecutive digits is at most 1.
		

Crossrefs

Primes in A378808.

Programs

  • Maple
    extend:= proc(x) local d,s,i;
      d:= ilog10(x);
      s:= floor(x/10^d);
      seq(10^(d+1)*i+x, i=s .. min(9,s+1))
    end proc:
    R:= 2,3,5,7: count:= 4:
    M:= [1,3,7,9];
    for d from 2 while count < 100 do
      M:= map(extend,M):
      S:= sort(select(isprime,M));
      count:= count+nops(S);
      R:= R,op(S);
    od:
    R; # Robert Israel, Feb 09 2025
  • Mathematica
    Select[Prime[Range[312218]],ContainsOnly[Drop[IntegerDigits[#],-1]-Rest[IntegerDigits[#]],{0,1}]&] (* James C. McMahon, Dec 21 2024 *)
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p), dd = vector(#d-1, k, d[k+1]-d[k])); (#dd==0) || ((vecmin(dd)>=-1) && (vecmax(dd)<=0))); \\ Michel Marcus, Dec 09 2024

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

A119535 Primeval primes: primes in A072857.

Original entry on oeis.org

2, 13, 37, 107, 113, 137, 1013, 1237, 1367, 10079, 10139, 12379, 13679, 100279, 100379, 123479, 1001237, 1002347, 1003679, 1012379
Offset: 1

Views

Author

N. J. A. Sloane, Jan 25 2008

Keywords

Crossrefs

Extensions

More terms extracted from A072857. - R. J. Mathar, Jun 11 2010

A135355 Semiprimes with digits in ascending order.

Original entry on oeis.org

4, 6, 9, 14, 15, 25, 26, 34, 35, 38, 39, 46, 49, 57, 58, 69, 123, 129, 134, 145, 146, 158, 159, 169, 178, 235, 237, 247, 249, 259, 267, 278, 289, 346, 358, 458, 469, 478, 489, 579, 589, 679, 689, 789, 1234, 1238, 1247, 1257, 1267, 1345, 1346, 1347, 1349, 1357
Offset: 1

Views

Author

Jonathan Vos Post, Dec 08 2007

Keywords

Comments

This is to A028864 as A001358 is to A000040. Semiprime metadromes in base 10. Contains 175 terms, the last being a(175)=12345789 = 3 * 4115263.
Snapshots: a(100)=13579, a(150)=135689, a(160)=245678, a(163)=356789, a(169)=1346789, a(173)=2356789. - R. J. Mathar, Dec 11 2007

Crossrefs

Programs

  • Maple
    isA001358 := proc(n) if numtheory[bigomega](n) = 2 then true; else false ; fi ; end: isA009993 := proc(n) local dgs,i ; dgs := convert(n,base,10) ; if nops(dgs) = 1 then RETURN(true) ; fi ; for i from 1 to nops(dgs)-1 do if op(i,dgs) <= op(i+1,dgs) then RETURN(false) ; fi ; od: RETURN(true) ; end: isA135355 := proc(n) isA001358(n) and isA009993(n) ; end: for n from 4 to 1400 do if isA135355(n) then printf("%d, ",n) ; fi ; od: # R. J. Mathar, Dec 11 2007
    # second Maple program:
    b:= proc(n) n, seq(b(10*n+j), j=irem(n, 10)+1..9) end:
    select(numtheory[bigomega]=2, {seq(b(n), n=1..9)})[];  # Alois P. Heinz, Apr 13 2025
  • Mathematica
    Select[Range[1357],PrimeOmega[#]==2&&AllTrue[Differences[IntegerDigits[#]],Positive]&] (* James C. McMahon, Apr 13 2025 *)

Formula

Equals A001358 INTERSECT A009993. - R. J. Mathar, Dec 11 2007

Extensions

Corrected by R. J. Mathar, Dec 11 2007
Showing 1-10 of 19 results. Next