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.

A374377 Least n-digit reversible prime whose difference from its reversal is maximal.

This page as a plain text file.
%I A374377 #18 Aug 02 2024 12:27:36
%S A374377 2,17,149,1069,10499,101999,1013899,10012999,100148999,1000009999,
%T A374377 10000099999,100009799999,1000000999999,10000069999999,
%U A374377 100001386999999,1000001939999999,10000004099999999,100000001599999999,1000000073599999999
%N A374377 Least n-digit reversible prime whose difference from its reversal is maximal.
%C A374377 Inspired by A374350.
%e A374377 Although the primes {149, 179, 199, 941, 971, 991} all have prime reversals and their differences are 792, 149 is the least. Therefore a(3) = 149.
%t A374377 a[n_] := Block[{lmt = 2*10^(n -1) +1, mx = 0, p = NextPrime[10^(n -1)], q}, While[p < lmt, q = IntegerReverse@ p; If[ PrimeQ@ q && Abs[p -q] > mx, mx = Abs[p -q]; pq = p]; p = NextPrime@ p]; pq];
%Y A374377 Cf. A374350.
%K A374377 base,nonn,more
%O A374377 1,1
%A A374377 _Robert G. Wilson v_, Jul 06 2024