Find all positive numbers x such that
1 1 1
--- - ---- = ----
[x] [2x] 6{x}
where [x] represents the integer part of x and {x}=x-[x].
Let [x] = a
let {x} = b
x = a+b
[2x] = either 2a if b<.5
or 2a+1 if b>=.5
Case 1: {x} < 0.5
1/a - 1/2a = 1/2a = 1/6b
2a = 6b
a = 3b, but b<.5 so 0<a<1.5
So a = 1 and b = 1/3 x = 4/3
Case 2: {x} >= 0.5
1/a - 1/(2a+1) = 1/2a = 1/6b
= ((2a+1) - (a))/(a(2a+1))
= (a+1)/(2a^2 + a) = 1/6b
6b(a+1) = 2a^2 + a
2a^2 + a(1-6b) - 6b = 0
and also .5 <= b < 1; or 3 <= 6b < 6
first check the extremes for 6b
3: 2a^2 - 2a - 3 = 0; a = (1 ± √7)/2
6: 2a^2 - 5a - 6 = 0; a = (5 ± √73)/4
The positive values are: 1.82287 and 3.3860
so for case 2, a is probably limited to being 2 or 3
Equation for case 2: and (.5 <= b < 1)
1/a - 1/(2a+1) = 1/2a = 1/6b
Try a=1
1 - 1/3 = 2/3 = 1/6b
b= 1/4 but we assumed b>1/2 a=1 is rejected
Try a=2 accepted
1/2 - 1/5 = 3/10 = 1/6b
b = 10/18 = 5/9 check
x = 2 5/9 = 23/9
try a=3 accepted
1/3 - 1/7 = 1/6b
4/21 = 1/6b
24b = 21
b = 21/24 = 7/8 check
x = 31/8
try a=4
1/4 - 1/9 = 1/6b
5/36 = 1/6b
30b = 36
b > 1 a=4 is rejected
x = {4/3, 23/9, 31/8}
---------
To double check, output of program:
[[4, 3], [23, 9], [31, 8]]
def lowestForm(a,b):
from math import gcd
return [int(a/gcd(a,b)), int(b/gcd(a,b))]
def f(x):
lhs = 1/int(x) - 1/int(2*x)
rhs = 1/(6*(x%1))
print(lhs)
print(rhs)
return abs(lhs - rhs) < .0000001
ans = []
for num in range(0,1001):
for den in range(1, 1001):
a = int(num/den)
c = int(2*num/den)
if a == 0:
continue
b = (num/den)%1
if b == 0:
continue
lhs = 1/a - 1/c
rhs = 1/(6*b)
if abs(lhs - rhs) < .0000001:
solution = lowestForm(num,den)
if solution not in ans:
ans.append(solution)
print(ans)
|
Posted by Larry
on 2025-03-10 13:02:27 |