%I #8 Jan 19 2019 15:28:34
%S 3,3,5,9,9,10,15,15,20,21,21,25,27,27,28,33,33,35,39,39,40,45,45,50,
%T 51,51,55,57,57,63,63,63,65,69,69,70,75,75,80,81,81,85,87,87,91,93,93,
%U 95,99,99,100,105,105,110,111,111,115,117,117,119,123,123,125,129,129,130
%N a(n) = the closest multiple of A053669(2n) to 2n. A053669(2n) = the smallest prime coprime to 2n.
%e The smallest prime coprime to 30 is 7. The largest multiple of 7 that is < 30 is 28. The smallest multiple of 7 that is > 30 is 35. 28 is closer to 30 than 35 is, so a(15) = 28.
%t cm[n_]:=Module[{nn=100,prs,cp,m1,m2},prs=Prime[Range[PrimePi[2*nn]]];cp=SelectFirst[prs,CoprimeQ[#,n]&];m1=cp*Floor[n/cp];m2=m1+cp;If[n-m1<=m2-n,m1,m2]] (* _Harvey P. Dale_, Jan 19 2019 *)
%Y Cf. A053669.
%K nonn
%O 1,1
%A _Leroy Quet_, Aug 19 2008
%E Extended by _Ray Chandler_, Jun 22 2009
|