1 and about 27.5247695102145
1 is the obvious solution just by inspection.
But Desmos shows there is a solution between 27 and 28
https://www.desmos.com/calculator/ydj4bcgrdk
The program below, searching values greater than 1, quickly zooms in on the other solution. When searching between 2 and 100 subdivided into 1000 intervals, it finds a solution that is between 27.48 and 27.578. Manually fine tuning the hi and lo values to be searched yields the other solution.
I was unable to search negative numbers because apparently the Python gamma function I am using does not accept negative inputs.
-------------------
import math
# lo = 27.524769510214558
# hi = 27.52476951021458
lo = 2
hi = 100
slices = 1000
for n in range(slices+1):
if n == 0:
prior = True
x = lo + n*(hi-lo)/slices
big20 = x**20
gama = math.gamma(x+1)
if big20 > gama:
notyet = True
else:
notyet = False
if prior == True:
print(x - (hi-lo)/slices, x)
break
prior = notyet
|
Posted by Larry
on 2024-04-04 10:14:20 |