%I #13 Dec 02 2018 13:41:20
%S 1,1,2,3,2,5,6,3,8,3,6,5,6,3,8,15,6,5,6,3,8,15,6,5,24,15,8,15,24,7,24,
%T 15,8,15,24,35,24,15,8,21,24,5,24,15,8,15,24,35,24,21,40,15,24,35,24,
%U 15,40,15,24,7,24,15,40,15,24,35,24,15,40,27,24,35,24,15,56,15,24,35,24
%N Multiply the positive integers which are coprime to n in order (starting at 1). a(n) is the largest such partial product that is <= n.
%H Harvey P. Dale, <a href="/A135873/b135873.txt">Table of n, a(n) for n = 1..1000</a>
%e 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.
%t 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 *)
%t 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 *)
%Y Cf. A135872.
%K nonn
%O 1,3
%A _Leroy Quet_, Dec 03 2007
%E More terms from _Stefan Steinerberger_, Feb 06 2008
|