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.
%I A374350 #28 Jul 31 2024 12:02:00 %S A374350 2,11,101,1231,10301,105601,1003001,10012001,100030001,1007457001, %T A374350 10000500001,100124521001,1000008000001,10000523500001, %U A374350 100000323000001,1000034344300001,10000000500000001,100000188981000001,1000000008000000001,10000001189110000001,100000000212000000001 %N A374350 Least n-digit reversible prime whose difference from its reversal is minimal. %C A374350 Inspired by A084475 and A373349. %C A374350 For n > 1, a(2n) has a difference of 9*10^n and a(2n-1) has a difference of 0. %F A374350 a(2n-1) = A100027(n) = A028989(n). %e A374350 a(3) = 101 since its reversal is also 101; %e A374350 a(4) = 1231 since its reversal is 1321 which is also prime and their difference is minimal at 90; %e A374350 a(6) = 105601 since its reversal is 106501 which is also prime and their difference is minimal at 900; %e A374350 a(8) = 10012001 since its reversal is 10021001 which is also prime and their difference is minimal at 9000; etc. %t A374350 fe[n_] := Block[{k = 1, j, p, q}, While[ j = k(10^IntegerLength[k]) + IntegerReverse[k +1]; p = 10^(2 n -1) + j(10^(n - IntegerLength[j]/2)) + 1; q = IntegerReverse@ p; !PrimeQ@ p || !PrimeQ@ q, k++; If[ Mod[k, 10] == 9, k++]]; p]; fe[1] = 11; %t A374350 fo[n_] := Block[{k = 0, j, p}, While[ j = k(10^(IntegerLength[k] -1)) + IntegerReverse@ Quotient[k, 10]; p = 10^(2n -2) + j(10^(n - (IntegerLength[j] + 1)/2)) +1; !PrimeQ@ p, k++]; p]; %t A374350 a[n_] := If[ OddQ@ n, fo[(n +1)/2], fe[n/2]]; Array[a, 21] %Y A374350 Cf. A028989, A084475, A100027, A114018, A373349, A374377. %K A374350 base,nonn %O A374350 1,1 %A A374350 _Robert G. Wilson v_, Jul 05 2024