OFFSET
1,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The positive integers which are coprime to 9 begin: 1,2,4,5,7,8,10,11,... Checking the partial products: 1=1, 1*2=2, 1*2*4 = 8, 1*2*4*5 =40,... 8 is the largest such partial product which is <= 9. So a(9) = 8.
MATHEMATICA
a = {}; For[n = 1, n < 80, n++, p = 1; i = 1; While[p < n, i++; If[GCD[i, n] == 1, p = p*i]]; AppendTo[a, p/i]]; a (* Stefan Steinerberger, Feb 06 2008 *)
Table[SelectFirst[Reverse[FoldList[Times, Select[Range[n], CoprimeQ[#, n]&]]], #<=n&], {n, 80}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 02 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 03 2007
EXTENSIONS
More terms from Stefan Steinerberger, Feb 06 2008
STATUS
approved