OFFSET
0,3
COMMENTS
A211396(n) <= a(n). - Reinhard Zumkeller, Feb 08 2013
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
EXAMPLE
a(10)=0, a(1227)=227.
MATHEMATICA
a[n_] := (id = IntegerDigits[n]; lg = Length[id]; sel = Select[ FromDigits /@ Flatten[ Table[ id[[i ;; j]], {i, 1, lg}, {j, i, lg}], 1], PrimeQ]; If[ sel === {}, 0, Last[ Sort[ sel] ] ]); Table[ a[n], {n, 0, 99}] (* Jean-François Alcover, Feb 23 2012 *)
lps[m_]:=Max[Select[Flatten[Table[FromDigits/@Partition[ IntegerDigits[ m], n, 1], {n, IntegerLength[m]}]], PrimeQ]]; Array[lps, 100, 0]/. -\[Infinity]->0 (* Harvey P. Dale, Feb 26 2014 *)
PROG
(Haskell)
import Data.List (isInfixOf)
a047814 n = if null ips then 0 else head ips
where ips = [p | p <- reverse $ takeWhile (<= n) a000040_list,
show p `isInfixOf` show n]
-- Reinhard Zumkeller, Feb 08 2013
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
Corrected (41) by Jean-François Alcover, Feb 23 2012
STATUS
approved