cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A319141 Prime numbers p such that p squared + p reversed is also prime.

This page as a plain text file.
%I A319141 #23 Sep 14 2018 03:18:35
%S A319141 211,223,271,283,433,463,691,823,859,2017,2029,2251,2269,2293,2341,
%T A319141 2347,2593,2647,2833,2851,2857,2887,4153,4327,4507,4513,4903,6091,
%U A319141 6361,6421,6481,6529,6871,6949,8011,8059,8161,8209,8287,8419,8467,8707,8803,8929,8971
%N A319141 Prime numbers p such that p squared + p reversed is also prime.
%C A319141 All terms == 1 (mod 6). - _Robert Israel_, Sep 13 2018
%H A319141 Robert Israel, <a href="/A319141/b319141.txt">Table of n, a(n) for n = 1..10000</a>
%e A319141 271 belongs to this sequence as 271 squared is 73441 and 271 reversed is 172 and the sum of 73441 and 172 is 73613, which is prime.
%p A319141 revdigs:= proc(n) local L,i;
%p A319141   L:= convert(n,base,10);
%p A319141   add(L[-i]*10^(i-1),i=1..nops(L));
%p A319141 end proc:
%p A319141 filter:= t -> isprime(t) and isprime(t^2+revdigs(t)):
%p A319141 select(filter, [seq(t,t=1..10^4,6)]); # _Robert Israel_, Sep 13 2018
%t A319141 Select[Prime@Range@1120, PrimeQ[#^2 + FromDigits[Reverse@IntegerDigits@#]] &] (* _Vincenzo Librandi_, Sep 14 2018 *)
%o A319141 (Python)
%o A319141 nmax=10000
%o A319141 def is_prime(num):
%o A319141     if num == 0 or num == 1: return(0)
%o A319141     for k in range(2, num):
%o A319141        if (num % k) == 0:
%o A319141            return(0)
%o A319141     return(1)
%o A319141 ris = ""
%o A319141 for i in range(nmax):
%o A319141     if is_prime(i):
%o A319141        r=int((str(i)[::-1]))
%o A319141        t=pow(i,2)+r
%o A319141        if is_prime(t):
%o A319141           ris = ris+str(i)+","
%o A319141 print(ris)
%o A319141 (PARI) forprime(p=1, 9000, if(ispseudoprime(p^2 + eval(concat(Vecrev(Str(p))))), print1(p, ", "))) \\ _Felix Fröhlich_, Sep 12 2018
%Y A319141 Cf. A304390.
%K A319141 nonn,base,look
%O A319141 1,1
%A A319141 _Pierandrea Formusa_, Sep 11 2018