Ask YC: Help Me With A Math Problem
k = x/(ln x)
k = x/(ln x)
x = k * ln x
for large k (and x):
x0 = k
x1 = k * ln k (plugging in x0 in for x)
x2 = k * ln (k * ln k) (plugging in x1 for x, etc...)
x3 = k * ln (k * ln (k * ln k))
x4 = k * ln (k * ln (k * ln (k * ln k)))
x5 = k * ln (k * ln (k * ln (k * ln (k * ln k))))
As this technique is asymptotic you can determine the error as it decreases with each iteration (usually just denoted as a big O of some small function). I tried this with k = 30 and the values of x I calculated were: 30, 102.03, 138.75, 147.98, 149.91, 150.30 respectively. To double check... 150.30/ln(150.30) = 29.9845.
Hope this helps.
Or more simply, if I wanted at least k primes, x would be a loose upper bound on the numbers I would have to look at.
So in short, approximation is good enough. I wrote the following to implement it:
def approximate(k, times)
return k if times < 1
return k * Math.log(approximate(k, times - 1))
end
For values of k I am looking at (1E4 up to 1E9), recursing 10 times approximated to within 0.01 of the actual value, which is definitely good enough for what I need.Thanks everyone for your replies. I'd still be interested in an exact answer, but at least this solves today's problem.
For k<0, there is exactly one solution for x, 0<x<1.
For 0<=k<e, there is no solution
For k=e, we simply have x=e.
For k>e, there are two solutions for x. Plot x/ln(x) on a graph and use numerical methods to find them.
I don't believe there's an analytic solution either. Otherwise it'd be in my CRC as x/ln(x) crops up quite a bit.
This seems related.
x= exp(k/(k-1))
my math is definitely rusty. be kind. (and i don't have my calculator)
edit: as pointed out by the comments, i'm wrong.