login
A088084
a(1) = 2; then least palindrome greater than the previous term such that every partial concatenation is a prime.
2
2, 3, 9, 11, 313, 353, 363, 373, 3993, 10401, 11911, 16061, 16861, 17571, 30903, 33633, 34043, 39693, 74347, 147741, 370073, 768867, 795597, 960069, 962269, 1036301, 1165611, 1405041, 1485841, 1498941, 1601061, 1644461, 1934391
OFFSET
1,1
EXAMPLE
2, 23, 239, 23911, etc., are primes.
MATHEMATICA
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.
CROSSREFS
Sequence in context: A242680 A275767 A088086 * A182203 A168080 A048084
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 22 2003
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Sep 27 2003
STATUS
approved