Система Диофанта - [13]
= -6; x>2 = -7 | 222) x>1 = -2; x>2 = -17 | |
223) x>1 = 10; x>2 = 1 | 224) x>1 = -6; x>2 = -13 | 225) x>1 = -7; x>2 = 17 |
226) x>1 = -2; x>2 = -3 | 227) x>1 = -10; x>2 = -7 | 228) x>1 = 2; x>2 = -17 |
229) x>1 = -1; x>2 = 17 | 230) x>1 = -3; x>2 = -11 | 231) x>1 = -4; x>2 = 17 |
232) x>1 = 15; x>2 = -2 | 233) x>1 = 5; x>2 = -17 | 234) x>1 = -10; x>2 = 3 |
235) x>1 = 2; x>2 = -1 | 236) x>1 = -1; x>2 = 7 | 237) x>1 = -21; x>2 = -5 |
238) x>1 = 4; x>2 = 11 | 239) x>1 = 10; x>2 = -1 | 240) x>1 = -2; x>2 = 17 |
241) x>1 = 9; x>2 = -11 | 242) x>1 = -3; x>2 = -13 | 243) x>1 = 3; x>2 = -1 |
244) x>1 = 6; x>2 = -7 | 245) x>1 = 25; x>2 = 5 | 246) x>1 = 9; x>2 = 7 |
247) x>1 = 9; x>2 = 13 | 248) x>1 = -9; x>2 = -7 | 249) x>1 = 4; x>2 = 2 |
250) x>1 = 25; x>2 = 1 | 251) x>1 = 14; x>2 = 7 | 252) x>1 = 9; x>2 = -2 |
253) x>1 = -1; x>2 = 13 | 254) x>1 = -6; x>2 = -1 | 255) x>1 = -7; x>2 = -7 |
256) x>1 = 4; x>2 = 7 | 257) x>1 = 49; x>2 = 2 | 258) x>1 = -9; x>2 = 13 |
259) x>1 = 7; x>2 = -13 | 260) x>1 = 1; x>2 = -17 | 261) x>1 = -2; x>2 = -1 |
262) x>1 = 4; x>2 = -2 | 263) x>1 = 4; x>2 = -13 | 264) x>1 = 15; x>2 = 2 |
265) x>1 = -25; x>2 = -1 | 266) x>1 = -4; x>2 = -1 | 267) x>1 = 21; x>2 = -1 |
268) x>1 = 9; x>2 = -5 | 269) x>1 = -15; x>2 = -3 | 270) x>1 = -14; x>2 = 1 |
271) x>1 = -9; x>2 = -1 | 272) x>1 = 6; x>2 = -13 | 273) x>1 = 2; x>2 = -13 |
274) x>1 = -15; x>2 = -2 | 275) x>1 = -4; x>2 = -17 | 276) x>1 = 4; x>2 = -17 |
277) x>1 = -15; x>2 = -5 | 278) x>1 = -25; x>2 = -5 | 279) x>1 = -6; x>2 = -11 |
280) x>1 = 21; x>2 = -2 | 281) x>1 = -10; x>2 = -3 | 282) x>1 = -21; x>2 = -3 |
283) x>1 = -14; x>2 = 7 | 284) x>1 = -49; x>2 = -2 | 285) x>1 = 10; x>2 = -11 |
286) x>1 = -9; x>2 = 11 | 287) x>1 = -9; x>2 = -3 | 288) x>1 = 25; x>2 = -2 |
289) x>1 = -14; x>2 = -7 | 290) x>1 = -4; x>2 = 7 | 291) x>1 = -35; x>2 = -3 |
292) x>1 = -21; x>2 = -1 | 293) x>1 = -4; x>2 = -7 | 294) x>1 = -2; x>2 = -13 |
295) x>1 = 1; x>2 = -13 | 296) x>1 = 10; x>2 = -3 | 297) x>1 = -25; x>2 = -3 |
298) x>1 = 25; x>2 = -3 | 299) x>1 = -4; x>2 = -5 | 300) x>1 = -1; x>2 = -17 |
301) x>1 = -3; x>2 = -3 | 302) x>1 = 6; x>2 = -1 | 303) x>1 = -4; x>2 = -11 |
304) x>1 = 15; x>2 = -1 | 305) x>1 = 25; x>2 = -1 | 306) x>1 = 4; x>2 = -3 |
307) x>1 = -5; x>2 = -5 | 308) x>1 = -4; x>2 = -13 | 309) x>1 = -9; x>2 = -13 |
310) x>1 = -10; x>2 = -11 | 311) x>1 = -9; x>2 = -5 | 312) x>1 = -1; x>2 = -13 |
313) x>1 = -4; x>2 = -3 | 314) x>1 = -1; x>2 = -1 | 315) x>1 = 4; x>2 = -7 |
316) x>1 = -10; x>2 = -1 | 317) x>1 = -9; x>2 = -11 | 318) x>1 = -49; x>2 = -1 |
Приложение 5. Последняя версия программы генерации задач
* Введена блокировка повторяющихся уравнений. (строки 48, 49 и функция comp_List)
* Убрав второй сомножитель в строке 41 — откажемся от усложнения уравнений.
* В строке 50 фрагмент «and abs(c) < 126» ограничивает величины цифр в уравнениях.
Ясно, что поиграв с кодом этого примера можно получить самые разнообразные листинги КУ.
>.1 | # -*- coding: utf-8 -*-
>.2 | import random
>.3 |
>.4 | def gen_number(k):
>.5 | . . prime_number =(1, 2, 3, 5, 7, 11, 13, 17)
>.6 | . . sign_number =(0, 1, 2, 3)
>.7 | . . nu = prime_number[random.randint(0, k)]
>.8 | . . sign = random.choice(sign_number)
>.9 | . . if sign == 0:
>10 | . . . . nu = nu * -1
>11 | . . return nu
>12 |
>13 | def show_numb(a):
>14 | . . if a > 0:
>15 | . . . . return ' + '+ str(a)
>16 | . . return ' - ' + str(abs(a))
>17 |
>18 | def comp_List(L, m):
>19 | . . for k in L:
>20 | . . . . if k == m :
>21 | . . . . . . return False
>22 | . . return True
>23 | . .
>24 | TopList = ['', '
>25 |
>26 | f = open("quadratic.htm", 'w')
>27 | f2 = open("answer.htm", 'w')
>28 |
>29 | for ind in TopList:
>30 | . . f.write(ind + '\n')
>31 | for ind in TopList:
>32 | . . f2.write(ind + '\n')
>33 |
') ')>34 | f.write('
\n')
\n')>35 | f2.write('
\n')
\n')>36 | tr = 0
>37 | count = 1
>38 | List = []
>39 |
>40 | for i in range(50000):
>41 | . . x1 = gen_number(4) * gen_number(4)
>42 | . . x2 = gen_number(7)
>43 | . . b = x1 + x2
>44 | . . c = x1 * x2
>45 | . .
>46 | . . m = str(b) + ' ' + str(c)
>47 | . . . . . .
>48 | . . if comp_List(List, m):
>49 | . . . . List.append(m)
>50 | . . . . if b != 0 and abs(c) < 126:
>51 | . . . . . . if tr == 0:
>52 | . . . . . . . . f.write('
') ')>53 | . . . . . . . . f2.write('
') ')>54 | . . . . . . f.write('
\n')>55 | . . . . . . f.write(str(count) + ') x2 '+ show_numb(b*-1) + 'x ' +show_numb(c) + ' = 0' )
>56 | . . . . . . f.write('
>57 | . . . . . . f2.write('
\n')>58 | . . . . . . f2.write(str(count) + ') x1 = '+ str(x1) + '; x2 = ' + str(x2) )
>59 | . . . . . . f2.write('
>60 | . . . . . . count += 1
>61 | . . . . . . tr += 1
>62 | . . . . . . if tr == 3:
>63 | . . . . . . . . f.write('
>64 | . . . . . . . . f2.write('
>65 | . . . . . . . . tr = 0
>66 |
>67 | f2.write('
>68 | f2.write('')
>69 | f2.close()
>70 | f.write('
>71 | f.write('