Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #6 Dec 05 2013 19:56:33
%S 2,3,9,11,313,353,363,373,3993,10401,11911,16061,16861,17571,30903,
%T 33633,34043,39693,74347,147741,370073,768867,795597,960069,962269,
%U 1036301,1165611,1405041,1485841,1498941,1601061,1644461,1934391
%N a(1) = 2; then least palindrome greater than the previous term such that every partial concatenation is a prime.
%e 2, 23, 239, 23911, etc., are primes.
%t NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] FromDigits[ Take[ idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[ idn, Ceiling[l/2]], Reverse[ Take[ idn, Floor[l/2]]]]], idfhn = FromDigits[ Take[ idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[ idfhn], Drop[ Reverse[ IntegerDigits[ idfhn]], Mod[l, 2]]]]]]]]; a = 2; k = 2; f[n_, m_] := Block[{k = NextPalindrome[m]}, While[b = FromDigits[ Join[ IntegerDigits[n], IntegerDigits[k]]]; !PrimeQ[b], k = NextPalindrome[k]]; Return[b]]; f[2, 2]; f[%, 3]; etc.
%Y Cf. A088085, A088086.
%K base,nonn
%O 1,1
%A _Amarnath Murthy_, Sep 22 2003
%E Edited, corrected and extended by _Robert G. Wilson v_, Sep 27 2003