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 A331806 #43 Jul 03 2020 14:53:54 %S A331806 3,13,5,31,7,71,73,109,11,199,13,313,197,241,17,307,19,419,401,463,23, %T A331806 599,577,701,677,757,29,929,31,1117,1153,1123,1259,1471,37,1481,1483, %U A331806 1873,41,1723,43,1979,2069,2161,47,2351,2593,2549,2551,2857,53,2969,2917,3191,3137 %N A331806 a(n) is the least prime p > n which is palindromic in base n. %C A331806 Using a representation where the digits of the prime are written between "[" and "]_" separated by commas with the base following the "_" then by checking up to a base of 7000 (where the lowest prime palindrome is [1, 1]_7000): %C A331806 1) Either the palindrome is [1, 1]_n where n is one less than a prime number, or [1, X, 1]_n where X << n, asymptotically. %C A331806 2) Many prime numbers occur more than once, e.g., %C A331806 13 is [1, 1, 1]_3 and [1, 1]_12; %C A331806 71 is [1, 3, 1]_7 and [1, 1]_70; %C A331806 1471 is [1, 7, 1]_35 and [1, 1]_1470. %H A331806 Colin M Ready, <a href="/A331806/b331806.txt">Table of n, a(n) for n = 2..7000</a> %F A331806 a(p-1) = p for prime p > 2. %F A331806 a(n) <= A087952(n) with equality if n+1 is not prime. - _M. F. Hasler_, Feb 27 2020 %e A331806 a(2) = 3 which is 11 in binary, a(3) = 13 which is 111 in ternary, a(4) = 5 which is 11 in quaternary, a(16) = 17 which is 11 in hexadecimal. %e A331806 If we use the representation described earlier, then: %e A331806 a(2) = 3 is [1, 1]_2, %e A331806 a(3) = 13 is [1, 1, 1]_3, %e A331806 a(4) = 5 is [1, 1]_4, %e A331806 a(11) = 199 is [1, 7, 1]_11, %e A331806 a(13) = 313 is [1, 11, 1]_13, %e A331806 a(16) = 17 is [1, 1]_16, %e A331806 a(48) = 2593 is [1, 6, 1]_48. %t A331806 Array[If[PrimeQ[# + 1], # + 1, Block[{p = If[PrimeQ@ #1, #1, Prime[#2 + 1]] & @@ {#, PrimePi[#]}}, While[! PalindromeQ@ IntegerDigits[p, #], Set[p, NextPrime@ p]]; p]] &, 55, 2] (* _Michael De Vlieger_, Jan 27 2020 *) %o A331806 (PARI) a(n) = {forprime(p=n+1, oo, my(d=digits(p, n)); if (Vecrev(d) ==d, return(p)););} \\ _Michel Marcus_, Jan 27 2020 %Y A331806 Cf. A006093 (prime(n) - 1), A087952 (least prime > n^2 and congruent to 1 (mod n)). %K A331806 nonn,base,easy %O A331806 2,1 %A A331806 _Colin M Ready_, Jan 27 2020