OFFSET
1,1
COMMENTS
Related to a palindrome, a semordnilap is a word that when reversed results in a new, different, valid word. For example the semordnilap of the word "desserts" is the word "stressed". Applying this principle to numbers, any number is either a palindrome or a semordnilap. This sequence deals with adjacent composite numbers whose semordnilap numbers are prime.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 2 * 17 = 34, which reverses to 43, a prime, we have n + 1 = 5 * 7 = 35, which reverses to 53, also a prime.
MATHEMATICA
searchMax = 2000; Select[Complement[Range[searchMax], Prime[Range[PrimePi[searchMax]]]], Not[PrimeQ[# + 1]] && PrimeQ[FromDigits[Reverse[IntegerDigits[#]]]] && PrimeQ[FromDigits[Reverse[IntegerDigits[# + 1]]]] &] (* Alonso del Arte, Feb 23 2017 *)
Select[Partition[Range[1500], 2, 1], AllTrue[#, CompositeQ] && AllTrue[ IntegerReverse[#], PrimeQ]&][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 10 2017 *)
PROG
(PARI) rev(n)=fromdigits(Vecrev(digits(n)))
is(n)=isprime(rev(n)) && isprime(rev(n+1)) && !isprime(n) && !isprime(n+1) \\ Charles R Greathouse IV, Feb 23 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Philip Mizzi, Feb 22 2017
STATUS
approved