It is shown that in the static, spherically symmetric spacetime the problem
of metric f(R) gravity coupled with non-linear Yang-Mills (YM) field
constructed from the Wu-Yang ansatz as source, can be solved in all dimensions.
By non-linearity it is meant that the YM Lagrangian depends arbitrarily on its
invariant. A particular form is considered to be in the power-law form with
limit of the standard YM theory. The formalism admits black hole solutions with
single or double horizons in which f(R) can be obtained, in general
numerically. In 6-dimensional case we obtain an exact solution given by
f(R)=\surdR gravity that couples with the YM field in a consistent manner.Comment: 12 pages, 8 figures, revised version with major changes including
expanded references. Dedicated to the memory of Yavuz Nutku (1943-2010