Efficient Computation of the Möbius Function

  • Context: Graduate 
  • Thread starter Thread starter CRGreathouse
  • Start date Start date
  • Tags Tags
    Computing Function
Click For Summary
SUMMARY

The discussion focuses on the efficient computation of the Möbius function, specifically through the use of the SquareFreeQ[n] function in Wolfram Mathematica. It highlights that determining if a number n is square-free involves computing MoebiusMu[n], which can be expedited if n has a small prime factor (≤ 1223). For larger n without small prime factors, the FactorInteger function is employed to find the smallest prime factor. The conversation also touches on the complexity of algorithms for computing the Möbius function and the potential for exponential-time improvements over naive methods.

PREREQUISITES
  • Understanding of the Möbius function and its properties
  • Familiarity with Wolfram Mathematica and its NumberTheoryFunctions package
  • Knowledge of prime factorization techniques
  • Basic concepts of computational complexity in number theory
NEXT STEPS
  • Explore the implementation of SquareFreeQ[n] in Wolfram Mathematica
  • Research advanced algorithms for computing the Möbius function
  • Learn about the implications of prime factorization on computational complexity
  • Investigate the relationship between the Möbius function and square-free numbers
USEFUL FOR

Mathematicians, computer scientists, and software developers interested in number theory, particularly those working with algorithms related to prime factorization and the Möbius function.

CRGreathouse
Science Advisor
Homework Helper
Messages
2,832
Reaction score
0
From the http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/NumberTheory/NumberTheoryFunctions.html :
SquareFreeQ[n] checks to see if n has a square prime factor. This is done by computing MoebiusMu[n] and seeing if the result is zero; if it is, then n is not squarefree, otherwise it is. Computing MoebiusMu[n] involves finding the smallest prime factor q of n. If n has a small prime factor (less than or equal to 1223), this is very fast. Otherwise, FactorInteger is used to find q.

How does this work? I can't think of a way to compute mu(n) faster than:
* finding a small p for which p^2 | n, or
* finding that n is prime, or
* checking that for all p < (n)^(1/3), p^2 does not divide n
* factoring n, which can be faster than the third option for large nEdit: I checked my copy of "Open problems in number theoretic complexity, II", which has O8: Is SQUAREFREES in P? Assuming that this is still open, any algorithm known would either be superpolynomial or of unproven complexity. But even an exponential-time improvement on the naive algorithm would be of interest.
 
Last edited by a moderator:
Physics news on Phys.org
The interesting line, to me, is this:
If n has a small prime factor (less than or equal to 1223), this is very fast.

This seems a fairly strong claim. In particular, it would mean that the "very fast" algorithm could distinguish between n = 2pq and n = 2pq^2 for large p and q.

I saw a reference to this at http://www.marmet.org/louis/sqfgap/ :
A faster algorithm is used by "Mathematica" to determine if a number is square-free. The method is quite interesting (see: http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/NumberTheory/NumberTheoryFunctions.html )
 
Last edited by a moderator:
The implication cannot be true, because it would mean that if N doesn't have a small factor, that we could compute \mu(N) = -\mu(3N), where the latter can be done rapidly.
 
Yeah, I figured as much, thanks.

So factoring n is pretty much the fastest way to find mu(n), right? Except in the special cases I outlined above?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
29
Views
5K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 175 ·
6
Replies
175
Views
26K
  • · Replies 82 ·
3
Replies
82
Views
16K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K