login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A113838 Palindromes sandwiched between twin primes. 1

%I #13 Jan 09 2016 14:07:43

%S 4,6,282,828,858,2112,21012,21612,23832,26262,26862,28182,80208,81018,

%T 82728,84348,89598,89898,240042,246642,270072,276672,2035302,2109012,

%U 2136312,2155512,2182812,2422242,2428242,2460642,2499942,2529252

%N Palindromes sandwiched between twin primes.

%C For n > 2, the first and last digit of a(n) are either 2 or 8. - _Chai Wah Wu_, Jan 06 2016

%C Intersection of A002113 and A014574. - _Michel Marcus_, Jan 08 2016

%H Chai Wah Wu, <a href="/A113838/b113838.txt">Table of n, a(n) for n = 1..10000</a>

%e 282 is a palindrome and 281 and 283 are twin primes.

%t palQ[n_]:= n == FromDigits@Reverse@IntegerDigits@n; lst={}; Do[If[palQ[n] && PrimeQ[n-1] && PrimeQ[n+1], AppendTo[lst, n]], {n, 2, 10^7, 2}]; lst

%t palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; Mean[#]&/@ Select[ Select[ Partition[Prime[Range[190000]],2,1], Last[#]-First[#] == 2&],palQ[Mean[#]]&] (* _Harvey P. Dale_, Jan 18 2012 *)

%o (PARI) isok(n) = my(d = digits(n)); (Vecrev(d)==d) && isprime(n-1) && isprime(n+1); \\ _Michel Marcus_, Jan 08 2016

%Y Cf. A002113 (palindrome), A014574 (average of twin prime pair).

%K base,nonn

%O 1,1

%A _Giovanni Resta_, Jan 24 2006

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 03:51 EDT 2024. Contains 371264 sequences. (Running on oeis4.)