%I #14 Dec 11 2023 14:16:59
%S 5,7,11,13,19,31,37,53,59,71,73,79,101,103,109,113,127,131,139,149,
%T 151,157,163,179,191,193,197,199,307,317,331,337,353,367,373,383,503,
%U 509,521,523,541,547,557,569,571,593,701,727,743,751,761,773,1009,1031,1033
%N Primes p such that (p reversed)+6 is also a prime.
%H Vincenzo Librandi, <a href="/A167460/b167460.txt">Table of n, a(n) for n = 1..1000</a>
%p rev:= proc(n) local L,i;
%p L:= convert(n,base,10);
%p add(L[-i]*10^(i-1),i=1..nops(L))
%p end proc:
%p select(t -> isprime(t) and isprime(rev(t)+6), [seq(i,i=3..2000,2)]); # _Robert Israel_, Dec 11 2023
%t Select[Prime[Range[2, 700]], PrimeQ[FromDigits[Reverse[IntegerDigits[#]]] + 6]&] (* _Vincenzo Librandi_, Sep 15 2013 *)
%o (Magma) [p: p in PrimesInInterval(2,1050) | IsPrime(q+6) where q is Seqint(Reverse(Intseq(p)))]; // _Vincenzo Librandi_, Sep 15 2013
%o (PARI) isok(p) = isprime(p) && isprime(fromdigits(Vecrev(digits(p)))+6); \\ _Michel Marcus_, Dec 11 2023
%K nonn,base
%O 1,1
%A _Vincenzo Librandi_, Nov 04 2009
%E 593 inserted, 769 removed by _R. J. Mathar_, Nov 08 2009
|