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.

Previous Showing 11-19 of 19 results.

A190221 Numbers all of whose divisors are numbers whose decimal digits are in nondecreasing order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 44, 45, 46, 47, 48, 49, 55, 56, 57, 58, 59, 66, 67, 68, 69, 77, 78, 79, 88, 89, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 125
Offset: 1

Views

Author

Jaroslav Krizek, May 06 2011

Keywords

Comments

Subset of A009994. Superset of A028864, A190218 and A190217.

Examples

			Number 112 is in sequence because all divisors of 112 (1, 2, 4, 7, 8, 14, 16, 28, 56, 112) are numbers whose decimal digits are in nondecreasing order.
		

Programs

  • Maple
    with(numtheory): A190221 := 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(A190221(n), n=1..64); # Nathaniel Johnston, May 06 2011
  • Mathematica
    ndoQ[n_]:=Min[Differences[IntegerDigits[n]]]>=0; Select[Range[ 200],AllTrue[ Divisors[#],ndoQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 02 2021 *)

A211655 Down-sortable primes: Primes that are also primes after digits are sorted into decreasing order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 41, 43, 53, 61, 71, 73, 79, 83, 97, 113, 131, 149, 157, 163, 167, 179, 181, 191, 197, 199, 211, 241, 251, 281, 311, 313, 331, 337, 347, 359, 373, 389, 419, 421, 431, 433, 443, 461, 463, 491, 521, 541, 563, 571, 593, 613, 617, 631, 641, 643, 653
Offset: 1

Views

Author

Francis J. McDonnell, Apr 17 2012

Keywords

Comments

All 1- and 2-digit reversible primes (A007500) are trivially in this sequence. No primes from A056709 are in this sequence. Clearly all absolute primes (A003459) are sortable primes but not all sortable primes are absolute primes. - Alonso del Arte, Oct 08 2013

Examples

			131 is prime and after sorting its digits into nonincreasing order we obtain 311, which is prime.
163 is in the sequence because its digits sorted in decreasing order give 631, which is prime. (Note that this is not a reversible prime, since 361 = 19^2.)
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]], PrimeQ[FromDigits[-Sort[-IntegerDigits[#]]]] &] (* T. D. Noe, Apr 17 2012 *)

A345325 Number of primes less than 10^n with digits in nondecreasing order.

Original entry on oeis.org

0, 4, 16, 50, 132, 315, 689, 1413, 2636, 4967, 8563, 14481, 23593, 37127, 56809, 86779, 127096, 184517, 264288, 368794, 510442, 707483, 948307, 1268871, 1689642, 2204795, 2866855, 3729223, 4738019, 6013021, 7619227, 9510372, 11832748, 14770667, 18067652
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 22 2021

Keywords

Comments

Number of primes with at most n digits arranged in nondecreasing order.

Crossrefs

Programs

  • Mathematica
    Table[Length@Select[Prime@Range[PrimePi[10^n]],OrderedQ@IntegerDigits@#&],{n,0,7}] (* Giorgos Kalogeropoulos, Jul 22 2021 *)
  • Python
    from sympy import isprime
    from itertools import accumulate, combinations_with_replacement as mc
    def numwithdigs(d):
        if d == 0: return 0
        nonincreasing = (int("".join(m)) for m in mc("123456789", d))
        return len(list(filter(isprime, nonincreasing)))
    def aupto(nn): return list(accumulate(numwithdigs(d) for d in range(nn+1)))
    print(aupto(14)) # Michael S. Branicky, Jul 22 2021

Extensions

a(11)-a(34) from Michael S. Branicky, Jul 22 2021

A343834 Primes with digits in nondecreasing order, only primes, and with sum of digits also a prime.

Original entry on oeis.org

2, 3, 5, 7, 23, 223, 227, 337, 557, 577, 2333, 2357, 2377, 2557, 2777, 33377, 222337, 222557, 233357, 233777, 235577, 2222333, 2233337, 2235557, 3337777, 3355777, 5555777, 22222223, 22233577, 23333357, 23377777, 25577777, 222222227, 222222557, 222222577
Offset: 1

Views

Author

Mikk Heidemaa, May 01 2021

Keywords

Comments

Intersection of A028864 and A062088.

Crossrefs

Programs

  • Mathematica
    a[p_] := With[{dg = IntegerDigits@p}, PrimeQ@p && OrderedQ@dg && AllTrue[dg, PrimeQ] && PrimeQ@ Total@dg]; Cases[ Range[3*10^7], _?(a@# &)] (* or *)
    upToDigitLen[k_] := Cases[ FromDigits@# & /@ Select[ Flatten[ Table[ Tuples[{2, 3, 5, 7}, {i}], {i, k}], 1], OrderedQ[#] &], _?(PrimeQ@# && PrimeQ@ Total@ IntegerDigits@# &)]; upToDigitLen[10]
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_combinations
    def aupton(terms):
      n, digits, alst = 0, 1, []
      while len(alst) < terms:
        mcstr = "".join(d*digits for d in "2357")
        for mc in multiset_combinations(mcstr, digits):
          sd = sum(int(d) for d in mc)
          if not isprime(sd): continue
          t = int("".join(mc))
          if isprime(t): alst.append(t)
          if len(alst) == terms: break
        else: digits += 1
      return alst
    print(aupton(35)) # Michael S. Branicky, May 01 2021

Extensions

a(33) and beyond from Michael S. Branicky, May 01 2021

A364458 Prime numbers that are not repdigits with digits in nondecreasing order with the property that any nontrivial permutation of the digits gives a composite number.

Original entry on oeis.org

19, 23, 29, 47, 59, 67, 89, 223, 227, 229, 233, 257, 269, 449, 499, 557, 599, 677, 1447, 2267, 2447, 4447, 5557, 8999, 11119, 15559, 22229, 22669, 23333, 24889, 44449, 48889, 55589, 55889, 59999, 79999, 222269, 444449, 455557, 555557, 555589, 666667, 4444469, 4555559
Offset: 1

Views

Author

Jean-Marc Rebert, Dec 23 2023

Keywords

Comments

The least terms with respectively 2, 3, 4 distinct digits are 19, 257, 24889.

Examples

			19 is a term, because the digits of 19 are in nondecreasing order and 91 is the unique number != 19 given by a permutation of 19 and 91 = 7 * 13 is composite and the digits of 91 are not in nondecreasing order.
		

Crossrefs

Programs

  • PARI
    is(k)=my(u=digits(k),n=#u);if(#vecsort(u,,8)==1||u!=vecsort(u)||!isprime(k),return(0));forperm(n,p,my(vp=Vec(p),v=[]);for(i=1,n,v=concat(v,u[vp[i]]));q=fromdigits(v);if(k!=q&&isprime(q),return(0)));1
    
  • PARI
    \\ See PARI link
    
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations as mp
    from itertools import count, islice, combinations_with_replacement as mc
    def bgen(d): yield from ("".join(m) for m in mc("123456789", d))
    def agen(): yield from (t for d in count(1) for k in bgen(d) if len(set(k))!=1 and isprime(t:=int(k)) if not any((j:="".join(m))!=k and isprime(int(j)) for m in mp(k)))
    print(list(islice(agen(), 44))) # Michael S. Branicky, Dec 23 2023

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

A155775 Indices j in A000040 such that j is an odd composite and the distinct digits of the prime A000040(j) are in increasing order.

Original entry on oeis.org

9, 15, 33, 35, 39, 55, 57, 69, 75, 77, 91, 203, 205, 207, 209, 219, 237, 247, 249, 355, 365, 391, 405, 483, 633, 749, 1475, 1501, 1515, 1595, 1605, 1615, 1631, 2611, 2637, 2829, 11603, 11803, 13479, 20797, 20891, 95375
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 27 2009

Keywords

Comments

These are the odd composites n (A071904) such that the digits of prime(n) are strictly increasing. The latter defines a subsequence of A028864, which lists primes with nondecreasing digits. - R. J. Mathar, Jan 30 2009

Examples

			If odd number=n=9 and prime(9)=23, then 2<3 and 9=a(1). If odd number=n=15 and prime(15)=47, then 4<7 and 15=a(2). If odd number=n=33 and prime(33)=137, then 1<3<7 and 33=a(3), etc.
		

Crossrefs

Extensions

Corrected and extended by R. J. Mathar, Jan 30 2009
Better definition from Omar E. Pol, Jan 31 2009

A296520 Multidigit primes in which the largest digit appears only once.

Original entry on oeis.org

13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 211, 223, 227, 229, 239, 241, 251, 257, 263, 269, 271
Offset: 1

Views

Author

Zak Seidov, Dec 14 2017

Keywords

Examples

			In 13 the last digit is the largest, in 131 the middle digit and in 41 the first digit.
		

Crossrefs

A156666 is a subsequence (except that the single-digit primes are included).

Programs

  • Mathematica
    Reap[Do[p=Prime[k];id=IntegerDigits[p];If[Count[id,Max[id]]==1,Sow[p]],{k,6,100}]][[2,1]]
    (* Second program: *)
    Select[Prime@ Range[5, 60], Last@ Select[DigitCount[#], # > 0 &] == 1 &] (* Michael De Vlieger, Dec 14 2017 *)

A352721 Perfect cubes whose decimal digits appear in nonincreasing order.

Original entry on oeis.org

0, 1, 8, 64, 1000, 8000, 64000, 1000000, 8000000, 64000000, 1000000000, 8000000000, 64000000000, 1000000000000, 8000000000000, 64000000000000, 1000000000000000, 8000000000000000, 64000000000000000, 1000000000000000000, 8000000000000000000, 64000000000000000000
Offset: 1

Views

Author

Antonio Roldán, Mar 30 2022

Keywords

Examples

			64 is in the sequence because it is a perfect cube (64 = 4^3) whose digits appear in nonincreasing order.
		

Crossrefs

Intersection of A000578 and A009996.

Programs

  • Mathematica
    Select[Range[0, 4*10^6]^3, Max@ Differences[IntegerDigits[#]] <= 0 &] (* Amiram Eldar, Mar 30 2022 *)
  • PARI
    ok(n) = digits(n) == vecsort(digits(n),,4) && ispower(n,3)

Formula

a(n) = A004647(n-1)^3.
Previous Showing 11-19 of 19 results.