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.

A367796 Primes p such that the sum of p and its reversal is the square of a prime.

This page as a plain text file.
%I A367796 #29 Dec 30 2023 23:12:00
%S A367796 2,29,47,83,20147,23117,24107,63113,80141,81131,261104399,262005299,
%T A367796 262104299,262203299,263302199,264203099,264302099,264500099,
%U A367796 270401489,271500389,273104189,273302189,274401089,282203279,284302079,284500079,291104369,291203369,292005269,293005169,293104169,294302069
%N A367796 Primes p such that the sum of p and its reversal is the square of a prime.
%C A367796 Terms > 83 have an odd number of digits and an even first digit.
%H A367796 David A. Corneth, <a href="/A367796/b367796.txt">Table of n, a(n) for n = 1..5743</a> (terms <= 10^15)
%H A367796 David A. Corneth, <a href="/A367796/a367796.gp.txt">PARI program</a>
%e A367796 A056964(a(n)) = 121 = 11^2 for 2 <= n <= 4.
%e A367796 A056964(a(n)) = 94249 = 307^2 for 5 <= n <= 10.
%e A367796 A056964(a(n)) = 1254505561 = 35419^2 for 11 <= n <= 71.
%p A367796 digrev:= proc(n) local L,i;
%p A367796   L:= convert(n,base,10);
%p A367796   add(L[-i]*10^(i-1),i=1..nops(L))
%p A367796 end proc:
%p A367796 filter:= proc(t) local v;
%p A367796   v:= sqrt(t+digrev(t));
%p A367796   v::integer and isprime(v)
%p A367796 end proc:
%p A367796 R:= 2, 29, 47, 83: count:= 4: flag:= true:
%p A367796 for d from 3 to 9 by 2 do
%p A367796   p:= prevprime(10^(d-1));
%p A367796   for i from 1 do
%p A367796     p:= nextprime(p);
%p A367796     p1:= floor(p/10^(d-1));
%p A367796     if p1::odd then p:= nextprime((p1+1)*10^(d-1)) fi;
%p A367796     if p > 10^d then break fi;
%p A367796     if filter(p) then
%p A367796        count:= count+1; R:= R,p;
%p A367796 fi od od:
%p A367796 R;
%t A367796 Select[Prime[Range[10^6]], PrimeQ[Sqrt[#+FromDigits[Reverse[IntegerDigits[#]]]]] &] (* _Stefano Spezia_, Dec 10 2023 *)
%o A367796 (PARI) \\ See PARI link
%Y A367796 Cf. A056964, A067030, A061783. Subset of A367793.
%K A367796 nonn,base
%O A367796 1,1
%A A367796 _Robert Israel_, Nov 30 2023