kyu_5.diophantine_equation package

Submodules

kyu_5.diophantine_equation.solution module

Solution for -> Diophantine Equation.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_5.diophantine_equation.solution.sol_equa(n: int) list[source]

Diophantine Equation solution.

Finds all integers x, y (x >= 0, y >= 0) solutions of a diophantine equation of the form x2 - 4 * y2 = n :param n: int :return: list

kyu_5.diophantine_equation.test_solution module

Test for -> Diophantine Equation.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_5.diophantine_equation.test_solution.SolutionTestCase(methodName='runTest')[source]

Bases: TestCase

Testing sol_equa function.

_classSetupFailed = False
_class_cleanups = []
pytestmark = [Mark(name='skip', args=(), kwargs={'reason': 'The solution is not ready'})]
test_solution_basic = None
test_solution_basic_0(**kw)

Testing using basic test data [with num=5, expected=[[3, 1]]].

Returns:

test_solution_basic_1(**kw)

Testing using basic test data [with num=12, expected=[[4, 1]]].

Returns:

test_solution_basic_2(**kw)

Testing using basic test data [with num=13, expected=[[7, 3]]].

Returns:

test_solution_basic_3(**kw)

Testing using basic test data [with num=16, expected=[[4, 0]]].

Returns:

test_solution_basic_4(**kw)

Testing using basic test data [with num=17, expected=[[9, 4]]].

Returns:

test_solution_basic_5(**kw)

Testing using basic test data [with num=20, expected=[[6, 2]]].

Returns:

test_solution_big = None
test_solution_big_0(**kw)

Testing using big test data [with num=900000, expected=[[112502, 56249], [56254, 28123]…0, 325], [1050, 225], [950, 25]]].

Returns:

test_solution_big_1(**kw)

Testing using big test data [with num=90004, expected=[[22502, 11250]]].

Returns:

test_solution_big_2(**kw)

Testing using big test data [with num=90005, expected=[[45003, 22501], [9003, 4499], [981, 467], [309, 37]]].

Returns:

test_solution_big_3(**kw)

Testing using big test data [with num=90009, expected=[[45005, 22502], [15003, 7500], …53, 290], [397, 130], [315, 48]]].

Returns:

test_solution_empty()[source]

Testing using empty test data.

Returns:

test_solution_medium = None
test_solution_medium_0(**kw)

Testing using medium test data [with num=9001, expected=[[4501, 2250]]].

Returns:

test_solution_medium_1(**kw)

Testing using medium test data [with num=9004, expected=[[2252, 1125]]].

Returns:

test_solution_medium_2(**kw)

Testing using medium test data [with num=9008, expected=[[1128, 562]]].

Returns:

test_solution_medium_3(**kw)

Testing using medium test data [with num=9009, expected=[[4505, 2252], [1503, 750], [647…], [103, 20], [97, 10], [95, 2]]].

Returns:

Module contents

Diophantine Equation.