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.

A103405 The 2^n-th palindromic prime.

This page as a plain text file.
%I A103405 #5 Mar 30 2012 17:31:11
%S A103405 2,3,7,151,757,14341,36563,1114111,1793971,7256527,115737511,
%T A103405 188646881,746676647,11984748911,19541414591,75174747157,
%U A103405 1192238322911,1901840481091,7382419142837,115344262443511,181836161638181
%N A103405 The 2^n-th palindromic prime.
%e A103405 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727 and 757 are the first sixteen palindromic primes.
%t A103405 NextPalindrome[n_] := Block[ {lg = Floor@ Log[10, n] + 1, idn = IntegerDigits@ n}, If[ Union@ idn == {9}, Return[n + 2], If[lg < 2, Return[n + 1], If[ FromDigits@ Reverse@ Take[ idn, Ceiling[lg/2]] > FromDigits@ Take[ idn, -Ceiling[lg/2]], FromDigits@ Join[ Take[ idn, Ceiling[lg/2]], Reverse@ Take[ idn, Floor[lg/2]]], idfhn = FromDigits@ Take[ idn, Ceiling[lg/2]] + 1; idp = FromDigits@ Join[ IntegerDigits@ idfhn, Drop[ Reverse@ IntegerDigits@ idfhn, Mod[lg, 2]]] ]]]];
%t A103405 c = 0; pal = 0; Do[ While[c < 2^n, pal = NextPalindrome@ pal; If[ PrimeQ@ pal, c++ ]]; Print@ pal, {n, 0, 20}]
%Y A103405 Cf. A083816.
%K A103405 base,nonn
%O A103405 1,1
%A A103405 _Robert G. Wilson v_, Feb 04 2005, corrected Nov 16 2006