Вот моё лобовое решение
>>> def odd_delimiters(n):
... yield 1
... for i in range(3, n // 2 + 1, 2):
... if n % i == 0:
... yield i
... if n % 2 != 0:
... yield n
...
>>> for i in range(35000000, 35000100):
... d = set(odd_delimiters(i))
... if len(d) < 5:
... print(i, d)
...
35000003 {1, 35000003, 12157, 2879}
35000006 {1, 17500003, 4549, 3847}
35000008 {257353, 1, 4375001, 17}
35000011 {1, 35000011}
35000012 {1, 163, 53681, 8750003}
35000015 {1, 7000003, 5, 35000015}
35000023 {1129033, 1, 35000023, 31}
35000024 {1, 2689, 1627, 4375003}
35000026 {1, 17500013}
35000027 {1, 35000027, 209581, 167}
35000029 {1, 1427, 35000029, 24527}
35000032 {1, 1093751}
35000036 {6047, 1, 8750009, 1447}
35000038 {1, 673, 26003, 17500019}
35000041 {1, 35000041}
35000044 {1, 8750011}
35000045 {1, 35000045, 7000009, 5}
35000047 {1, 211, 165877, 35000047}
35000048 {1, 2187503, 977, 2239}
35000053 {1, 11, 35000053, 3181823}
35000057 {275591, 1, 35000057, 127}
35000062 {1, 17500031}
35000066 {1, 17500033, 760871, 23}
35000067 {35000067, 1, 3, 11666689}
35000068 {1, 8750017}
35000072 {11423, 1, 4375009, 383}
35000074 {1, 17500037}
35000077 {1, 5000011, 35000077, 7}
35000078 {1, 15667, 1117, 17500039}
35000079 {1, 3, 11666693, 35000079}
35000080 {1, 2187505, 437501, 5}
35000081 {443039, 1, 35000081, 79}
35000083 {1, 35000083}
35000084 {1, 1250003, 8750021, 7}
35000086 {1, 1590913, 11, 17500043}
35000087 {1, 660379, 53, 35000087}
35000088 {1458337, 1, 3, 4375011}
35000092 {1, 143443, 61, 8750023}
35000093 {1, 35000093, 2058829, 17}
35000094 {1, 3, 5833349, 17500047}
35000096 {1, 1093753}
35000099 {1, 35000099}
>>>
Твоё лобовое решение упускает много чисел, у которых меньше пяти нечётных делителей
>>> from math import sqrt
>>>
>>> a_min=35000000
>>> a_max=35000100
>>>
>>> for i in range(a_min, a_max + 1):
... res = []
... for d1 in range(2, int(sqrt(i))+1):
... if i % d1 == 0:
... if d1 % 2 == 1:
... res.append(d1)
... d2 = i // d1
... if d2 % 2 == 1 and d2 != d1:
... res.append(d2)
... if len(res) >= 5:
... break
... if 0 < len(res) < 5:
... print( i,'>', res)
...
35000001 > [3, 11666667, 9, 3888889]
35000003 > [2879, 12157]
35000006 > [17500003, 3847, 4549]
35000008 > [4375001, 17, 257353]
35000012 > [8750003, 163, 53681]
35000015 > [5, 7000003]
35000023 > [31, 1129033]
35000024 > [4375003, 1627, 2689]
35000026 > [17500013]
35000027 > [167, 209581]
35000029 > [1427, 24527]
35000032 > [1093751]
35000033 > [19, 1842107, 361, 96953]
35000036 > [8750009, 1447, 6047]
35000037 > [3, 11666679, 9, 3888893]
35000038 > [17500019, 673, 26003]
35000044 > [8750011]
35000045 > [5, 7000009]
35000047 > [211, 165877]
35000048 > [2187503, 977, 2239]
35000053 > [11, 3181823]
35000057 > [127, 275591]
35000062 > [17500031]
35000066 > [17500033, 23, 760871]
35000067 > [3, 11666689]
35000068 > [8750017]
35000072 > [4375009, 383, 11423]
35000074 > [17500037]
35000077 > [7, 5000011]
35000078 > [17500039, 1117, 15667]
35000079 > [3, 11666693]
35000080 > [5, 2187505, 437501]
35000081 > [79, 443039]
35000084 > [8750021, 7, 1250003]
35000086 > [17500043, 11, 1590913]
35000087 > [53, 660379]
35000088 > [3, 4375011, 1458337]
35000092 > [8750023, 61, 143443]
35000093 > [17, 2058829]
35000094 > [17500047, 3, 5833349]
35000096 > [1093753]
>>>