Предмет: Информатика, автор: Чувакеекк

Пусть М — разность максимального и минимального натуральных
делителей целого числа, не считая единицы и самого числа Если таких
делителей у числа нет, то считаем значение M равным нулю.

Напишите программу, которая перебирает целые числа, большие 860 000, в
порядке возрастания и ищет среди них такие, для которых значение м
оканчивается на 18. Вывести первых пять найденных чисел и
соответствующие им значения М. Формат вывода: для каждого из пяти таких
найденных чисел в отдельной строке сначала выводится само число, затем –
значения М. Строки выводятся в порядке возрастания найденных чисел.
Например, для числа 20 м = 10 - 2 = 8

Приложения:

Ответы

Автор ответа: badnsnus
2

Ответ:

860040

860163

860219

860240

860440

Объяснение: Код может чуток тормозить

for i in range(860000, 100000000000):

   delit = []

   for j in range(2, i//2+1):

       if i % j == 0:

           delit.append(j)

   if len(delit) > 0:

       m = delit[-1] - delit[0]

       if m % 100 == 18:

           print(i)

Похожие вопросы
Предмет: Қазақ тiлi, автор: aliyabimuratova
Предмет: Английский язык, автор: lerka007v
Ребята помогите Срочно                                                                                               . Books ... for children are usually very well illustrated.
a) publishing b) publish c) having published d) published
3. I don't understand why you let your brother ... to you like that.
a) to speak b) speak c) spoke d)speaking
4. Nothing went wrong while I was gone, ...?
a) didn't it b) did it not c) did it d) did they
5. I have given up ... tennis but I still ... golf.
a) playing ... to play b) to play ... playing c) playing ... play d) to play ... to play
6. What ... since you arrived?
a) are you doing b) did you do c) have you been d) will you do doing
7. I refused to give him ... help.
a) any b) some c) no d) the
8. I am not going to help you with your homework and neither ... John.
a) is going too b) isn't c) isn't going d) is .
9. There are usually ... students at the lecture of this professor.
a) a lot more b) less c) much more d) far less
10. I've taken ... clothes with me. Next time I am going to take more.
a) little b) much c) few d) a little
11.He promised that he would go sightseeing if he ... free.
a) was b) would be c) will be d) is
12 Neither Ann nor her sister ... to go to the disco tonight.
a) intend b) don't intend c) doesn't intend d) intends
13. They were made ... their suitcases.
a) open b) to open c) opening d) opened
14. Where do you usually have your hair ...?
a) cutting b) to cut c) having cut d) cut
15. Since ... nothing much to see, we left.
a) it was b) there was c) there is d) was there .
16.It was a through train so we ... change trains.
a) mustn't b) hadn't c) didn't have to d) had not to
17. He asks me when ... last.
a) did I see him b) I saw him c) have I seen him d) I have seen
18. Many people like to get up very early in the morning, ... like to sleep until noon.
a) the others b) others c) the other d) other
19. He could open the lock ... .
a) easily b) easy c) most easy d) easiest
20 …. a big difference between them.
a) It is b) There is c) This is d) It isn't
21. He repaired my oid watch so I ... buy a new one.
a) mustn't b) had not to c) didn't have to d) had to
22. Nearly ... house in the country has television.
a) each b) no c) every d) all
23. Let's ... long.
a) don't stay out b) don't to stay out c) not to stay out d) not stay out
24. 1 don't like coffee, and my husband doesn't like it... .
a) too b) either c) also d) as well
25. Let's stay at home ... it stops raining.
a) until b) by c) though d) before
Предмет: Алгебра, автор: nikita2005nikita2005