Note first that the function fn(x) satisfies fn(x)=fn(n+1−x):
fn(n+1−x)=k=1∑n∣n+1−x−k∣=k=1∑n∣x−(n+1−k)∣=k=1∑n∣x−k∣=fn(x)
by reversing the order of summation. Let us first consider the case x<1: then, x−k<0 for every k≥1 and thus
fn(x)=k=1∑n(k−x)=2n(n+1)−nx>2n(n+1)−n=2n(n−1)≥210⋅9=45>41,
so this case can be excluded. By symmetry (identity above), we can exclude x>n as well. Thus we are left with 1≤x≤n. Suppose that x∈[ℓ,ℓ+1] for some integer ℓ with 1≤ℓ≤n−1. Then x−k≤0 for k≥ℓ+1 and x−k≥0 for k≤ℓ, and we obtain
fn(x)=k=1∑ℓ(x−k)+k=ℓ+1∑n(k−x)=ℓx−2ℓ(ℓ+1)+2(n−ℓ)(n+ℓ+1)−(n−ℓ)x=2n(n+1)−ℓ(ℓ+1)+(2ℓ−n)x.
This shows that fn(x) is strictly decreasing on [ℓ,ℓ+1] if ℓ<2n, constant on [2n,2n+1] (if n is even) and strictly increasing on [ℓ,ℓ+1] if ℓ>2n. We conclude:
* If n is even, then fn(x) is strictly decreasing on [1,2n], constant on [2n,2n+1] and strictly increasing on [2n+1,n].
* If n is odd, then fn(x) is strictly decreasing on [1,2n+1] and strictly increasing on [2n+1,n].
We see that the minimum of fn(x) is always attained at m=⌊2n+1⌋. Now we can complete squares in the above to obtain
fn(m)=2n(n+1)−m(m+1)+(2m−n)m=2n(n+1)+m2−(n+1)m=2n(n+1)+(m−2n+1)2−(2n+1)2≥2n(n+1)−(2n+1)2=4n2−1.
If n≥13, then this implies fn(x)≥fn(m)≥4132−1=42>41 for all x, so that there is no solution. It remains to consider n∈{10,11,12}.
* For n=10, we obtain from above that
f10(23)=55−2−8⋅23=41
and by the symmetry property f10(219)=41. In view of our monotonicity considerations, f10(x)≥41 for x≤23 and x≥219 and f10(x)<41 on the remaining interval. So we find that the solution set in this case is (23,219).
* For n=11, we have
f11(719)=66−6−7⋅719=41
and f11(765)=41 by symmetry. The same argument as before shows that the solution set is (719,765) in this case.
* For n=12, we have
f12(417)=78−20−4⋅417=41
and f12(435)=41 by symmetry. Hence we obtain the solution set (417,435) in this case.
Let us summarize the solutions:
* 23<x<219 for n=10,
* 719<x<765 for n=11,
* 417<x<435 for n=12,
* no solutions if n≥13.