Mathematically, the integers should fall within the interval m/6 < n <= m/5
, which gives use only 8
and 9
as feasible n
values.
To verify the result, you can try
>>> g(47,7)
6
>>> g(47,8)
5
>>> g(47,9)
5
>>> g(47,10)
4
If you don't mind check all possible values, you can try
[[n, g(47,n)] for n in range(1,47)]
which gives
>>> [[n, g(47,n)] for n in range(1,47)]
[[1, 47], [2, 23], [3, 15], [4, 11], [5, 9], [6, 7], [7, 6], [8, 5], [9, 5], [10, 4], [11, 4], [12, 3], [13, 3], [14, 3], [15, 3], [16, 2], [17, 2], [18, 2], [19, 2], [20, 2], [21, 2], [22, 2], [23, 2], [24, 1], [25, 1], [26, 1], [27, 1], [28, 1], [29, 1], [30, 1], [31, 1], [32, 1], [33, 1], [34, 1], [35, 1], [36, 1], [37, 1], [38, 1], [39, 1], [40, 1], [41, 1], [42, 1], [43, 1], [44, 1], [45, 1], [46, 1]]