OFFSET
5,1
COMMENTS
a(n) is only defined for n >= 5, because for n < 5, the condition {c composite, c < n} results in the empty set.
LINKS
Robert Israel, Table of n, a(n) for n = 5..10000
Paul Erdos, Some unconventional problems in number theory, Acta Mathematica Hungarica, 33(1):71-80, 1979. See p. 73.
EXAMPLE
a(5) = 6 because the largest composite c < n = 5 is 4, which has the largest prime factor 2. Hence a(5) = 4 + 2 = 6. - David A. Corneth, Dec 03 2018
MAPLE
N:= 100: # to get a(5)..a(N)
V:= Vector(N):
V[5]:= 6;
for n from 6 to N do
if isprime(n-1) then V[n]:= V[n-1]
else V[n]:= max(V[n-1], n-1+min(numtheory:-factorset(n-1)))
fi
od:
convert(V[5..N], list); # Robert Israel, Dec 03 2018
MATHEMATICA
a[n_] := Module[{smax = 0}, Do[If[CompositeQ[m], smax = Max[smax, m + FactorInteger[m][[1, 1]]]], {m, 2, n-1}]; smax]; Array[a, 100, 5] (* Amiram Eldar, Dec 02 2018 *)
PROG
(PARI) a(n) = {my(smax = 0); for(m=2, n-1, if (!isprime(m), smax = max(smax, m + factor(m)[1, 1]); )); smax; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Dec 02 2018
STATUS
approved