I was playing around with numbers and wanted to create a function that somehow indicates if a number could be a prime. So I came up with this, with the intention that it should make small jumps if x is a prime number:
f(n)=n−1∑k=21knmodkn
It inneed does small jumps at small primes, but in general the term seems to converge to something close around 0.422780.
Why is this? I would expect this sum to grow without bounds, as for a large number N, there should be a lot of numbers which do not divide N without remainder.
Answer
We have n(modk)=k{n/k} where {x} is the fractional part of x.
Hence we are interested in the behaviour of the sort-of-average-value
f(n)=1nn−1∑k=2{n/k}
which as n→∞, by Riemann sums, converges to
I=∫10{1x}dxx↦1/x=∫+∞1{x}x2dx=∑m≥1∫10x(x+m)2dx
which equals
∑m≥1(log(m+1)−log(m)−1m+1)=∑m≥1(1m−1m+1)⏟1−∑m≥1(1m−log(1+1m))⏟γ
i.e. 1−γ≈0.422784335 as claimed by Daniel Fischer.
No comments:
Post a Comment