OFFSET
1,1
COMMENTS
for all primes p>2: a(p)=a(p-1)=p and if p is not the lesser member of a twin prime pair, then also a(p+1)=p;
(n,n+2) is a twin prime pair iff a(n-1)=a(n)=n and a(n+1)=a(n+2)=a(n+3)=n+2.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) > 47 if n > 212381. - Charles R Greathouse IV, Feb 19 2013
PROG
(Haskell)
a093074 1 = 2
a093074 n = maximum $ map a006530 [n-1..n+1]
-- Reinhard Zumkeller, Jul 04 2012
(PARI) a(n)=my(p=precprime(n+1)); if(p>n-2, p, vecmax(apply(n->vecmax(factor(n)[, 1]), [n-1, n, n+1]))) \\ Charles R Greathouse IV, Feb 19 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 18 2004
STATUS
approved