OFFSET
1,5
COMMENTS
a(1) = 0 because 0 is coprime with 1, for our purposes and is < 1.
The numbers n with a(n) = 1 are given in A048597. - Stefan Steinerberger, Oct 16 2007
LINKS
Diana Mecum, Table of n, a(n) for n = 1..1163 [From Diana L. Mecum, Aug 05 2008]
EXAMPLE
a(14) = 9 because 9 is the largest nonprime integer < 14 which is coprime to 14 (since the other nonprime integers > 9 and < 14 {10 and 12} aren't coprime with 14).
MATHEMATICA
a = {0}; For[n = 2, n < 70, n++, i = n - 1; While[PrimeQ[i] || GCD[n, i] > 1, i-- ]; AppendTo[a, i]]; a (* Stefan Steinerberger, Oct 16 2007 *)
lnp[n_]:=Module[{k=n-1}, While[PrimeQ[k]||!CoprimeQ[k, n], k--]; k]; Array[ lnp, 80] (* Harvey P. Dale, May 12 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 12 2006
EXTENSIONS
More terms from Stefan Steinerberger, Oct 16 2007
Terms 70 through 1163 from Diana L. Mecum, Aug 05 2008
STATUS
approved