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-4 of 4 results.

A095179 Numbers whose reversed digit representation is prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 14, 16, 17, 20, 30, 31, 32, 34, 35, 37, 38, 50, 70, 71, 73, 74, 76, 79, 91, 92, 95, 97, 98, 101, 104, 106, 107, 110, 112, 113, 118, 119, 124, 125, 128, 130, 131, 133, 134, 136, 140, 142, 145, 146, 149, 151, 152, 157, 160, 164, 166, 167, 170, 172
Offset: 1

Views

Author

Cino Hilliard, Jun 21 2004

Keywords

Comments

If m is a term, then 10*m is another term. - Bernard Schott, Nov 20 2021

Examples

			The number 70 in reverse is 07 = 7, which is prime.
		

Crossrefs

Cf. A004086, A007500 (primes in this sequence), A076055 (composites in this sequence), A204232 (base-2 analog), A097312.

Programs

  • Maple
    q:= n-> (s-> isprime(parse(cat(s[-i]$i=1..length(s)))))(""||n):
    select(q, [$1..200])[];  # Alois P. Heinz, Aug 22 2021
  • Mathematica
    Select[Range[200], PrimeQ[FromDigits[Reverse[IntegerDigits[#]]]] &] (* Harvey P. Dale, Jun 13 2013 *)
  • PARI
    r(n) = for(x=1,n,y=eval(rev(x));if(isprime(y),print1(x","))) \ Get the reverse of the input string rev(str) = { local(tmp,j,s); tmp = Vec(Str(str)); s=""; forstep(j=length(tmp),1,-1, s=concat(s,tmp[j])); return(s) }
    
  • PARI
    is_A095179(n)=isprime(eval(Strchr(vecextract(Vec(Vecsmall(Str(n))),"-1..1")))) \\ M. F. Hasler, Jan 13 2012
    
  • PARI
    isok(n) = isprime(fromdigits(Vecrev(digits(n)))); \\ Michel Marcus, Aug 22 2021
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(int(str(n)[::-1]))
    print(list(filter(ok, range(1, 173)))) # Michael S. Branicky, Aug 22 2021

Extensions

Offset corrected to 1 by Alonso del Arte, Apr 12 2020

A076056 Primes which when read backwards are composite numbers.

Original entry on oeis.org

19, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 103, 109, 127, 137, 139, 163, 173, 193, 197, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 317, 331, 349, 367, 379, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457
Offset: 1

Views

Author

Amarnath Murthy, Oct 04 2002

Keywords

Comments

Subsidiary sequences that could be added:(1) Start of the first occurrence of n consecutive primes in the above sequence. (2) Start of the first occurrence of n consecutive primes with digit reversal also a prime.
The subsidiary sequence (1) with the indices at which n>=2 consecutive primes are first found in this sequence is 1, 1, 4, 4, 4, 4, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, ... - R. J. Mathar, May 22 2009
Subsequence of A151768. - Reinhard Zumkeller, Jul 06 2009

Crossrefs

Cf. A076055.
Complement of A007500 with respect to A000040. [From Reinhard Zumkeller, Jul 06 2009]

Programs

  • Magma
    [p: p in PrimesUpTo(500)|not IsPrime(Seqint(Reverse(Intseq(p))))]; // Vincenzo Librandi, Jun 03 2019
  • Mathematica
    Select[Prime[Range[100]], !PrimeQ[FromDigits[Reverse[IntegerDigits[ # ]]]]&]

Extensions

More terms from Harvey P. Dale, Oct 11 2002

A224400 Composite numbers that become prime when their digits are put in nondecreasing order.

Original entry on oeis.org

20, 30, 32, 50, 70, 74, 76, 91, 92, 95, 98, 110, 130, 170, 172, 175, 176, 190, 194, 200, 203, 209, 217, 230, 232, 272, 275, 290, 292, 296, 300, 301, 302, 310, 319, 320, 322, 323, 329, 332, 370, 371, 374, 376, 391, 392, 394, 395, 398, 407, 437, 470, 473, 475
Offset: 1

Views

Author

Keywords

Comments

Conjecture: a(n) ~ 7.75*n.

Examples

			217 = 7*31, but 127 is prime. 302 = 2*151, but 23 is prime.
		

Crossrefs

Subset of A007935.

Programs

  • Mathematica
    Select[Range[500], ! PrimeQ[#] && PrimeQ[FromDigits[Sort[IntegerDigits[#]]]] &] (* T. D. Noe, Apr 05 2013 *)
  • R
    j=1; y=c(); library(gmp)
    while(length(y)<1000) {
    if(isprime((j=j+1))==0) {
    x=sort(as.numeric(strsplit(as.character(j),spl="")[[1]]))
    if(isprime(paste(x[x>0],collapse=""))>0) y=c(y,j) #drop leading zeros
    }
    }

A224402 Composite numbers that become prime when their digits are put in nonincreasing order.

Original entry on oeis.org

14, 16, 34, 35, 38, 112, 118, 119, 121, 124, 125, 128, 133, 134, 136, 142, 143, 145, 146, 152, 154, 164, 166, 175, 176, 182, 188, 194, 214, 215, 218, 314, 316, 334, 341, 343, 344, 346, 356, 358, 361, 364, 365, 368, 374, 377, 385, 386, 388, 395, 398, 412, 413
Offset: 1

Views

Author

Keywords

Comments

Because any number ending in zero is composite, the sequence experiences gaps of at least order O(a(n))-1 between changes in the most significant digit.

Examples

			194=2*97, but 941 is prime.
		

Crossrefs

Subset of A007935.

Programs

  • Mathematica
    Select[Range[500], ! PrimeQ[#] && PrimeQ[FromDigits[Reverse[Sort[IntegerDigits[#]]]]] &] (* T. D. Noe, Apr 05 2013 *)
  • R
    j=1; y=c(); library(gmp)
    while(length(y)<1000) {
    if(isprime((j=j+1))==0) {
    x=sort(as.numeric(strsplit(as.character(j),spl="")[[1]]),decr=T)
    if(isprime(paste(x,collapse=""))>0) y=c(y,j)
    }
    }
Showing 1-4 of 4 results.