login
Palindromic primes with middle digit 1.
1

%I #19 Sep 08 2022 08:45:10

%S 313,919,18181,30103,35153,38183,93139,1201021,1221221,1281821,

%T 1311131,1371731,1411141,1461641,1551551,1611161,1761671,1831381,

%U 1851581,1881881,1941491,1951591,1981891,3001003,3091903,3181813,3211123,3241423

%N Palindromic primes with middle digit 1.

%H David A. Corneth, <a href="/A082436/b082436.txt">Table of n, a(n) for n = 1..32860</a>

%t Select[Prime[Range[250000]],OddQ[IntegerLength[#]]&& PalindromeQ[#] && IntegerDigits[ #][[(IntegerLength[#]+1)/2]]==1&](* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Dec 31 2018 *)

%o (Magma) [ p: p in PrimesUpTo(200000000) | IsOdd(d) and D[(d+1) div 2] eq 1 and D eq Reverse(D) where d is #D where D is Intseq(p) ]; // _Vincenzo Librandi_, Apr 12 2011

%o (PARI) first(n) = {my(res = List(), t = 0); forstep(i = 1, oo, 10, c = A002113(i); if(#digits(c) % 2 == 1 && isprime(c), print1(c", "); t++; listput(res, c); if(t == n, return(res))))} \\ _David A. Corneth_, Dec 31 2018

%Y Cf. A002385.

%K nonn,easy,less,base

%O 1,1

%A _Lekraj Beedassy_, Apr 25 2003

%E a(22) from _Vincenzo Librandi_, Apr 12 2011