A088269 Palindromic primes that yield a prime when sandwiched between two 1's. (Prefixing and suffixing a 1 on both sides yields another palindromic prime.)
3, 5, 131, 383, 797, 11411, 16061, 16361, 19391, 33533, 36263, 73037, 75557, 79397, 1074701, 1126211, 1145411, 1175711, 1221221, 1243421, 1287821, 1303031, 1311131, 1328231, 1363631, 1489841, 1579751, 1600061, 1707071, 1748471
Offset: 1
Examples
Take palindromic primes (A002385) and see whether inserting them between two digits '1' again yields a prime: Insert a(1) = 3 between the digits of 11 to get 131, a prime. Insert a(2) = 5 between the digits of 11 to get 151, a prime. Inserting 11 between two '1's yields 1111 = 11 * 101, not a prime. Insert a(3) = 131 between the digits of 11 to get 11311, a prime. Insert a(10) = 33533 between the digits of 11 to get 1335331, a prime, etc. 797 is a term as 17971 is also a prime.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..100
Programs
-
Mathematica
Do[If[PrimeQ[n] && Reverse[IntegerDigits[n]] == IntegerDigits[n] && PrimeQ[ToExpression["1" <> ToString[n*10+1]]], Print[n]], {n, 1, 2*10^6}] (* Ryan Propper, Jul 09 2005 *) palsQ[n_]:=Module[{idn=IntegerDigits[n],idn1},idn1=Join[{1},idn,{1}]; idn==Reverse[idn]&&idn1==Reverse[idn1]&&PrimeQ[FromDigits[idn1]]]; Select[Prime[Range[150000]],palsQ] (* Harvey P. Dale, Jan 04 2012 *)
-
PARI
is_A088269(n)={isprime(n)&&(n=digits(n))==Vecrev(n)&&isprime(fromdigits(concat([1,n,1])))} \\ M. F. Hasler, Nov 19 2018
Extensions
a(6)-a(30) from Ryan Propper, Jul 09 2005
Entry revised by N. J. A. Sloane, Apr 29 2007
Edited by M. F. Hasler, Nov 19 2018
Comments