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.

Original entry on oeis.org

2, 29, 47, 83, 20147, 23117, 24107, 63113, 80141, 81131, 261104399, 262005299, 262104299, 262203299, 263302199, 264203099, 264302099, 264500099, 270401489, 271500389, 273104189, 273302189, 274401089, 282203279, 284302079, 284500079, 291104369, 291203369, 292005269, 293005169, 293104169, 294302069
Offset: 1

Views

Author

Robert Israel, Nov 30 2023

Keywords

Comments

Terms > 83 have an odd number of digits and an even first digit.

Examples

			A056964(a(n)) = 121 = 11^2 for 2 <= n <= 4.
A056964(a(n)) = 94249 = 307^2 for 5 <= n <= 10.
A056964(a(n)) = 1254505561 = 35419^2 for 11 <= n <= 71.
		

Crossrefs

Cf. A056964, A067030, A061783. Subset of A367793.

Programs

  • Maple
    digrev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    filter:= proc(t) local v;
      v:= sqrt(t+digrev(t));
      v::integer and isprime(v)
    end proc:
    R:= 2, 29, 47, 83: count:= 4: flag:= true:
    for d from 3 to 9 by 2 do
      p:= prevprime(10^(d-1));
      for i from 1 do
        p:= nextprime(p);
        p1:= floor(p/10^(d-1));
        if p1::odd then p:= nextprime((p1+1)*10^(d-1)) fi;
        if p > 10^d then break fi;
        if filter(p) then
           count:= count+1; R:= R,p;
    fi od od:
    R;
  • Mathematica
    Select[Prime[Range[10^6]], PrimeQ[Sqrt[#+FromDigits[Reverse[IntegerDigits[#]]]]] &] (* Stefano Spezia, Dec 10 2023 *)
  • PARI
    \\ See PARI link