%I #7 Aug 27 2017 08:48:54
%S 1,2,3,4,5,6,7,7,7,5,7,6,7,7,5,7,7,6,7,5,7,7,7,6,5,7,7,7,7,5,7,7,7,7,
%T 5,6,7,7,7,5,7,6,7,7,5,7,7,6,7,5,7,7,7,6,5,7,7,7,7,5,7,7,7,7,5,6,7,7,
%U 7,5
%N The arithmetic function uhat(n,5,2).
%C The sequence appears to be equal to uhat(n,5,3), at least to 10000 terms.
%H Bela Bajnok, <a href="https://arxiv.org/abs/1705.07444">Additive Combinatorics: A Menu of Research Problems</a>, arXiv:1705.07444 [math.NT], May 2017. See Table in Section 1.6.4.
%t delta[r_, k_, d_] := If[r < k, (k - r)*r - (d - 1), If[k < r && r < d, (d - r)*(r - k) - (d - 1), If[k == r && r == d, d - 1, 0]]] uhat[n_, m_, h_] := (dx = Divisors[n]; dmin = n; For[i = 1, i ≤ Length[dx], i++, d = dx[[i]]; k = m - d*Ceiling[m/d] + d; r = h - d*Ceiling[h/d] + d; If[h ≤ Min[k, d - 1], dmin = Min[dmin, n, (h*Ceiling[m/d] - h + 1)*d, h*m - h*h + 1], dmin = Min[dmin, n, h*m - h*h + 1 - delta[r, k, d]]]]; dmin) Table[uhat[n, 5, 2], {n, 1, 70}]
%Y Cf. A289435, A289436, A289437, A289438, A289439, A289440, A289441.
%K nonn
%O 1,2
%A _Robert Price_, Aug 26 2017