Interesting article on prime approximation via the Lambert W function - Practical potential?

Joined
Aug 20, 2021
Messages
17
Reaction score
5
Hello everyone,

I stumbled upon an intriguing (and quite well-presented) >article< that proposes a new analytical approach to prime numbers using the Lambert W function. I thought it would be a perfect topic for discussion here.

The Core Idea (The Article's Contribution):
The author starts from the reverse of Fermat's Little Theorem. For an odd prime p, we have:
2^(p-1) ≡ 1 (mod p) which implies K = (2^(p-1) - 1) / p
where K is an integer. The novel part is that the author then solves for p explicitly using the Lambert W function W(z), arriving at:
p = -W( -ln(2) / (2K) ) / ln(2)
It's a neat and elegant analytical trick. The author also provides an approximate formula:
p ≈ ln(K)/ln(2) + ln(ln(K))/ln(2) + C
where C is a constant (roughly around 2 for the examples tried).

Here's a table demonstrating the idea (using C = 2):


10~8.74 - 135, 7, 11, 13
50~19.214 - 2417, 19, 23
100~24.820 - 2923, 29
500~40.535 - 4537, 41, 43
[th]
K​
[/th][th]
Approx. p​
[/th][th]
Search Range (±5)​
[/th][th]
Primes in Range​
[/th]​
As you can see, the neighborhood of the approximation consistently contains primes. The potential computational saving is massive. For N = 10^10, instead of a sieve working on ~10^10 elements, you'd only need to perform a primality test on about (number of primes) * (window size) ≈ 455e6 * 20 ≈ 9e9 tests, which is already competitive, not to mention the huge memory savings.

Points for Discussion / Critiques:
  1. Not New in Spirit, But Novel in Approach: Using an approximation for the n-th prime (p_n ~ n log n) is standard. The novelty here is the parameterization via K from Fermat's Little Theorem and the use of the Lambert W.
  2. The Elephant in the Room - Pseudoprimes: The fundamental issue is that K is also an integer for composite numbers satisfying Fermat's base-2 test (e.g., Carmichael numbers). The sequence of K is "polluted." Any practical algorithm using this must account for this.
  3. The Practical Hurdles: The value of the constant C isn't universal, and the error in the approximation likely grows with K. How do we dynamically choose the search window size reliably?
  4. Comparison: How does this approximation's accuracy compare to more standard ones like p_n ≈ n(ln n + ln ln n - 1)?
Conclusion:
The article itself might overhype its findings a bit by framing it as a "formula for primes," but if we look past that, there's a genuinely clever idea here. It's probably not a standalone solution but could it be the basis for a highly efficient hybrid search algorithm? What are your thoughts on the validity of the approach and its practical potential?

Links:
I'm curious to hear what you all think.
 

Members online

No members online now.

Forum statistics

Threads
2,555
Messages
9,909
Members
706
Latest member
irlenBingus
Back
Top