Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A111337
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A111337 Primes with at least two digits such that swapping the second and the penultimate digit yields a prime. +0
1
11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331 (list; graph; listen)
OFFSET

1,1

COMMENT

Is this sequence infinite?

LINKS

T. D. Noe, Table of n, a(n) for n=1..10000

EXAMPLE

The prime 612041 is in the sequence because swapping the second and the penultimate digit yields 642011, which is prime.

MATHEMATICA

a = {}; For[n = 5, n < 100, n++, b = IntegerDigits[Prime[n]]; {b[[2]], b[[ -2]]} = {b[[ -2]], b[[2]]}; If[PrimeQ[FromDigits[b]], AppendTo[a, Prime[n]]]]; a

PROGRAM

(PARI) swap(n, d) = \ d is the digit position to swap { local(j, ln, x, s, y, y2, tmp); forprime(x=10^(d-1), 10^(d-1)+n, s = Str(x); ln = length(s); y = eval(Vec(s)); tmp=y[d]; y[d]=y[ln-d+1]; y[ln-d+1]=tmp; y2=0; for(j=1, ln, y2+=y[j]*10^(ln-j); ); if(isprime(y2), print1(x", ")) ) }

CROSSREFS

Sequence in context: A052031 A166009 A105892 this_sequence A162237 A090236 A032502

Adjacent sequences: A111334 A111335 A111336 this_sequence A111338 A111339 A111340

KEYWORD

base,easy,nonn

AUTHOR

Cino Hilliard (hillcino368(AT)gmail.com), Nov 05 2005

EXTENSIONS

Edited by Stefan Steinerberger (stefan.steinerberger(AT)gmail.com), Aug 01 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research