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.

Showing 1-1 of 1 results.

A152034 a(n) = largest n-digit prime p whose reversal is a prime q > p.

Original entry on oeis.org

79, 769, 9679, 98999, 995699, 9975899, 99967999, 999548999, 9999049999, 99994169999, 999989299999, 9999954799999, 99999904999999, 999999778999999, 9999999349999999, 99999994999999999, 999999971189999999, 9999999950999999999, 99999999632999999999
Offset: 2

Views

Author

Zak Seidov, Nov 20 2008

Keywords

Crossrefs

Programs

  • Maple
    revdigs:= proc(x) local L,i; L:= convert(x,base,10); add(L[-i]*10^(i-1),i=1..nops(L)) end proc:
    f:= proc(n)
      local d,a,B,r;
      for d from floor(n/2) by -1 do
         B:= (10^d-1)*(1+10^(n-d));
         for a from 10^(n-2*d)-1 to 1 by -1 do
           r:= revdigs(a);
           if r > a and isprime(B+10^d*a) and isprime(B+10^d*r) then return B+10^d*a fi
         od
      od
    end proc:
    map(f, [$2..20]); # Robert Israel, Aug 16 2016
  • Mathematica
    Do[ p = NextPrime[10^(n ), -1 ]; Do[ p1 = FromDigits[ Reverse[IntegerDigits[p]]]; If[PrimeQ[p1] && p1 > p, Print[{n, p}]; Break[]]; p = NextPrime[p, -1], {10^9}], {n, 2, 15}];

Extensions

More terms from Max Alekseyev, May 03 2011
Showing 1-1 of 1 results.