2

The details about Landau function can be found in A000793.

Maybe there is some methods in A000793, but I don't understand what it says. If possible, can someone illustrate the method?

Jiabin He
  • 247

1 Answers1

2

I considered Michael Somos' pari script and added some comments :

{  a(n) = 
   local(m, t, j, u); 
   if (n < 2, 
       n >= 0, \\the result 0 or 1
   \\else
       m = ceil( n/exp(1) ); 
       t = ceil( (n/m)^m ); 
       j=1;                  \\init of result
       for (i=2, t, 
           u = factor(i);    \\returns [p1,a1],[p2,a2],...,[pm,am] if i=p1^a1 p2^a2...pm^am
           u = sum( k=1, matsize(u)[1], u[k, 1]^u[k, 2]); \\sum k=1 to m of pk^ak
           if (u <= n, j=i)  \\if the sum is not larger than n memorize i
       ); 
       j   \\the result
   )
}

Note that pari/gp is free and rather convenient for tests !

This requires quite some factorizations. The referenced paper by Deleglise, Jean-Louis Nicolas and Paul Zimmermann 'Landau's function for one million billions' should be more interesting for large values.

Raymond Manzoni
  • 43,021
  • 5
  • 86
  • 140