login
A141584
a(n) = the closest multiple of A053669(2n) to 2n. A053669(2n) = the smallest prime coprime to 2n.
0
3, 3, 5, 9, 9, 10, 15, 15, 20, 21, 21, 25, 27, 27, 28, 33, 33, 35, 39, 39, 40, 45, 45, 50, 51, 51, 55, 57, 57, 63, 63, 63, 65, 69, 69, 70, 75, 75, 80, 81, 81, 85, 87, 87, 91, 93, 93, 95, 99, 99, 100, 105, 105, 110, 111, 111, 115, 117, 117, 119, 123, 123, 125, 129, 129, 130
OFFSET
1,1
EXAMPLE
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.
MATHEMATICA
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 *)
CROSSREFS
Cf. A053669.
Sequence in context: A079586 A354953 A125960 * A287195 A179437 A136791
KEYWORD
nonn
AUTHOR
Leroy Quet, Aug 19 2008
EXTENSIONS
Extended by Ray Chandler, Jun 22 2009
STATUS
approved