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.

User: Francis J. McDonnell

Francis J. McDonnell's wiki page.

Francis J. McDonnell has authored 3 sequences.

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

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
    

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

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 *)

A208130 Numbers that when expressed in decimal are equal to the sum of the digits sorted into nondecreasing order and raised to the powers 1, 2, 3, ...

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 89, 135, 2537, 60409, 4901732, 17735872, 45279768, 393470463, 3623008669, 3893095238, 229386834955666, 1892713761283624, 1501212693940707502, 1517944702855898904, 12303679765763687463, 122947811178635339597, 1095354314191826124704, 1106509957063490820877
Offset: 1

Author

Francis J. McDonnell, Mar 29 2012

Keywords

Comments

Lemma: The sequence is finite with all terms in the sequence having at most 22 digits. Proof: Let n be an m-digit natural number in the sequence for some m. Then 10^(m-1) <= n and n <= 9 + 9^2 + ... + 9^m = 9(9^m-1)/8 < (9^(m+1))/8. Thus 10^(m-1) < (9^(m+1))/8. Taking logarithms of both sides and solving yields m < 22.97. QED. The sequence listed, found by a computer program searching up to 10^22, is therefore complete. - Francis J. McDonnell, Apr 12 2012

Examples

			2537 = 2^1 + 3^2 + 5^3 + 7^4 = 2 + 9 + 125 + 2401.
60409 = 0^1 + 0^2 + 4^3 + 6^4 + 9^5 = 0 + 0 + 64 + 1296 + 59049.
		

Crossrefs

Cf. A032799 (does not sort the digits prior to raising to powers).

Programs

  • Java
    // See McDonnell link.
    
  • Python
    from itertools import combinations_with_replacement
    A208130_list = []
    for l in range(1,23):
        for n in combinations_with_replacement(range(10),l):
            x = sum(b**(a+1) for a,b in enumerate(n))
            if x > 0 and tuple(sorted(int(d) for d in str(x))) == n:
                A208130_list.append(x)
    A208130_list = sorted(A208130_list)  # Chai Wah Wu, May 20 2017

Extensions

More terms added by Francis J. McDonnell, Apr 12 2012
Faster program used to obtain more terms included by Francis J. McDonnell, Apr 16 2012