This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A262463 If n is prime a(n) = n else a(n) = nextprime(reverse(n)), where "next prime" is the smallest prime >= n, see A007918. 1
 2, 2, 3, 5, 5, 7, 7, 11, 11, 2, 11, 23, 13, 41, 53, 61, 17, 83, 19, 2, 13, 23, 23, 43, 53, 67, 73, 83, 29, 3, 31, 23, 37, 43, 53, 67, 37, 83, 97, 5, 41, 29, 43, 47, 59, 67, 47, 89, 97, 5, 17, 29, 53, 47, 59, 67, 79, 89, 59, 7, 61, 29, 37, 47, 59, 67, 67, 89, 97, 7, 71, 29, 73, 47, 59, 67, 79, 89, 79, 11, 19, 29 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 LINKS Maghraoui Abdelkader, Table of n, a(n) for n = 1..200 FORMULA a(n)=n if n is prime;        else b=reverse(n);        if b is prime a(n)=b else a(n)=nextprime(b); (using "next prime" function as "smallest prime >= n"; see A007918. ) EXAMPLE For n=7 a(7)=7. For n=12, reverse(12)=21; a(12)=nextprime(21)=23. MATHEMATICA Table[Which[PrimeQ[n], n, PrimeQ[IntegerReverse[n]], IntegerReverse[n], True, NextPrime[ IntegerReverse[ n]]], {n, 100}] (* Harvey P. Dale, May 12 2018 *) PROG (PARI) rev(n)={d=digits(n); p=""; for(i=1, #d, p=concat(Str(d[i]), p)); return(eval(p))} i=0; t=vector(200); findn(n)={if(isprime(n), t[i++]=n, a=rev(n); b=nextprime(a); t[i++]=b); } for(n=1, 200, findn(n)); t CROSSREFS Cf. A000040, A077018. Sequence in context: A237710 A090473 A113636 * A151800 A259430 A290838 Adjacent sequences:  A262460 A262461 A262462 * A262464 A262465 A262466 KEYWORD nonn,base AUTHOR Maghraoui Abdelkader, Sep 23 2015 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 18 04:50 EDT 2019. Contains 326072 sequences. (Running on oeis4.)