-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProblem2_Equation
32 lines (19 loc) · 939 Bytes
/
Problem2_Equation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
x>0
y>0
x,y both belong to real numbers
let y^2 =t
solution to problem lies in finding a pair (t,x) such that
t^3= x^6 + 8*(x^4) - 6*(x^2) +8
(SOLUTION IN PYTHON3:)
def is_perfect_cube(x):
return int(round(x**(1./3))) ** 3 ==x
def calc():
for i in range(100):
y= (i**6) + 8*(i**4) -6*(i**2) +8
if(is_perfect_cube(y)):
print(i)
the above code checks for x in range 0 -100 if it satisfies the above equation
and the first solution is found for x=3 and t=11
so answer
3345x + 4321t= 3345*3 + 4321*11=57566
NOTE: ITS GIVEN THAT SOLUTION DOES NOT EXCEED 10^7 SO FEASIBLE RANGE FOR CHECKING (BRUTE – FORCING) FOR THE VALUE OF x WAS TILL 100.