OFFSET
3,1
LINKS
Robert Israel, Table of n, a(n) for n = 3..10000
FORMULA
a(n) = min{lpf(n-1),lpf(n),lpf(n+1)}, where lpf is the largest prime factor: lpf(k) = A006530(k).
EXAMPLE
a(93) = min{lpf(92),lpf(93),lpf(94)} = min{23,31,47} = 23.
MAPLE
LPF:= map(t -> max(numtheory:-factorset(t)), [$2..101]):
[seq](min(LPF[i..i+2]), i=1..nops(LPF)-2); # Robert Israel, Jun 16 2025
MATHEMATICA
LPF = FactorInteger[ # ][[ -1, 1]] &; Map[Min[{LPF[ # - 1], LPF[ # ], LPF[ # + 1]}] &, Range[3, 200]]
Min/@Partition[Table[FactorInteger[n][[-1, 1]], {n, 110}], 3, 1] (* Harvey P. Dale, May 25 2015 *)
PROG
(PARI) a(n) = my(lpf(k)=vecmax(factor(k)[, 1])); vecmin([lpf(n-1), lpf(n), lpf(n+1)]); \\ Ruud H.G. van Tol, Aug 15 2024
(Python)
from sympy import primefactors
def a(n): return min(map(lambda n: primefactors(n)[-1], range(n-1, n+2))) # David Radcliffe, Jun 16 2025
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Carlos Alves, Nov 27 2006
STATUS
approved
