OFFSET
1,4
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000 (first 255 terms from Lior Manor)
EXAMPLE
a(7) = 9 because 9 is the largest nonprime integer < 14 (the 7th composite) (since the other nonprime integers > 9 and < 14 {10 and 12} aren't coprime with 14).
MAPLE
N:=300:
NP:= remove(isprime, [$1..N]):
for i from 2 to nops(NP) do
x:= NP[i];
for k from i-1 by -1 do
if igcd(NP[k], x) = 1 then A[i-1]:=NP[k]; break fi
od
od:
seq(A[i], i=1..nops(NP)-1); # Robert Israel, Dec 02 2019
MATHEMATICA
lnni[n_]:=Max[Select[Range[n-1], CompositeQ[#]&&CoprimeQ[#, n]&]]; lnni/@ Select[Range[200], CompositeQ]/.(-\[Infinity]->1) (* Harvey P. Dale, Jan 19 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 12 2006
EXTENSIONS
More terms from Lior Manor, Nov 21 2007
STATUS
approved