For b denoting sqrt(2) find all possible values of x, satisfying :
(b+1)^x +(b-1)^x=34
x=4
part 1
First guess; consider 2*(√2)^x = 34
(√2)^x = 17
so x is close to 4.
Plugging 4 in does work, so 4 is the answer.
part2
Algebraic confirmation assuming x=4
(b+1)^4 +(b-1)^4 1 4 6 4 1
2b^4 + 12b^2 + 2 = 34
b^4 + 6b^2 + 1 = 17
b^4 + 6b^2 - 16 = 0
Let c = b^2
c^2 + 6c - 16 = 0
c = b^2 = (-6 ± √(36 + 64))/2
just use the positive version due to √
b^2 = (-6 + 10)/2 = 4/2 = 2
So b = √2
part 3
The program below looks for a solution and also comes up with 4.
----
def f(x, b=2**.5):
return (b+1)**x +(b-1)**x
closest = 0
distance = 10000
for i in range(399900,400001):
x = i/100000
error = abs(f(x) - 34)
if error < distance:
distance = error
closest = x
print(closest)
Output: 4
|
Posted by Larry
on 2023-04-11 11:58:03 |