|
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <htevhh$ka0$1@fred.mathworks.com>...
> "Bill Sinclair" <billsincl@aol.com> wrote in message <hte34u$hnf$1@fred.mathworks.com>...
> > ........
> > But still I can't come up with a formula for F(N). I am wondering if this problem has ever been solved(?)
> > ........
>
> I suspect that first matlab code I sent you (not the brute force part) will come as close as you are ever going to get to a "formula" for what you call F(N). I'll show you what I mean.
>
> If N is a prime number p, then it is always true that
>
> F(p) = (2^p+(p-1)*2)/p
>
> which seems like a nice tidy little formula. However it does not extend to non-primes. If N is the product of two distinct prime numbers p and q, then the rule changes and we suddenly get a different formula
>
> F(p*q) = (2^(p*q)+(p-1)*2^q+(q-1)*2^p+(p-1)*(q-1)*2)/(p*q)
>
> in place of the previous one, or if N is the square of a prime number p, then you have
>
> F(p^2) = (2^(p^2)+(p-1)*2^p+p*(p-1)*2)/p^2
>
> again an abrupt change.
>
> Life becomes increasingly burdensome when N is the product of three distinct primes, p, q, and r. It has the following unpleasant look:
>
> F(p*q*r) = (2^(p*q*r)+(p-1)*2^(q*r)+(q-1)*2^(r*p)+(r-1)*2^(p*q) ...
> +(q-1)*(r-1)*2^p+(r-1)*(p-1)*2^q+(p-1)*(q-1)*2^r ...
> +(p-1)*(q-1)*(r-1)*2)/(p*q*r)
>
> (Check it out with N = 2*3*5 = 30 and compare with the matlab code.)
>
> As you can well guess, as the complexity of the factorization of N into prime factors becomes more complex, so does the formula for F(N).
>
> Fortunately, that very simple algorithm I showed in the first section of code encompasses all of the above varieties of formulae and gives what I claim is about the closest you will ever come to a single formula for F(N). There are many mathematicians who deal primarily in prime number theory, and they would no doubt be very happy regarding such an algorithm as having "solved the problem".
>
> Of course there is nothing unique about using matlab here. The same algorithm could be expressed in a great many computer languages, but it is difficult to express with ordinary mathematical symbols, because it is so closely tied up with the prime factorization of N.
>
> By the way, I should warn you that that first matlab code section will work only up to N = 53. Beyond that, matlab's double precision numbers are incapable of handling the resulting large integers in an exact fashion, since their significands possess only 53 bits. The brute force code of course will run you out of time and memory long before 53.
>
> Roger Stafford
Very good work Roger ! !
I assume you derived those formulas yourself.
When I get home I can check those up to N=26.
Actually, I have a good way to get above N=53, since my Fortran 2003 allows 8 byte integers, up to about 9.22E18 or 2^63 - 1. Actually, does your Matlab allow long integers like that?
But checking those results might be pretty hopeless, unless I use your recursion formula. N=26 takes a couple of minutes, and it about doubles for each new N.
Yours; Bill S.
PS: Wonder if you can get the Fields medal?
|