OFFSET
1,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The 12th composite is 21. The divisors of 12 are 1,2,3,4,6,12. The divisors of 12 that are coprime to 21 are 1,2,4. 4 is the largest of these, so a(12) = 4.
MAPLE
A002808 := proc(n) option remember ; local a; if n = 1 then 4; else for a from A002808(n-1)+1 do if not isprime(a) then RETURN(a) ; fi ; od: fi ; end: A137925 := proc(n) local dvs, d, a002808 ; a002808 := A002808(n) ; dvs := sort(convert(numtheory[divisors](n), list), `>`) ; for d in dvs do if gcd(d, a002808) = 1 then RETURN(d) ; fi ; od: end: seq(A137925(n), n=1..120) ; # R. J. Mathar, Apr 17 2008
MATHEMATICA
ldc[{n_, x_}]:=Module[{divs=Divisors[n]}, Max[Select[divs, CoprimeQ[ #, x]&]]]; Module[{nn=120, c, len}, c=Select[Range[nn], CompositeQ]; len=Length[c]; ldc/@Thread[{Range[len], c}]] (* Harvey P. Dale, May 24 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 23 2008
EXTENSIONS
More terms from R. J. Mathar, Apr 17 2008
STATUS
approved