mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Math (https://www.mersenneforum.org/forumdisplay.php?f=8)
-   -   Counting Integers and their Multiplicities (https://www.mersenneforum.org/showthread.php?t=7530)

m_f_h 2007-03-26 23:06

p(n) = r(n)-r(n-1) (of which r(n)/n is the mean value) is given by
[tex]
p(n) = \sum_{i=1}^n
\sum_{L\subset \{i...n-1\}} \frac{(-1)^{{\rm card}L}}{{\rm lcm} L\cup\{n\}}
[/tex]
The sum over L is in principle over all subsets of {i...n-1}, but one can easily see that one can remove elements of this set which are a multiple of another element;
also, the sum does not contribute anything if {i,...,n-1} contains a divisor of n, so it's sufficient to sum over i larger than the biggest proper divisor of n.

The sums are then of the form, for example
1/x + 1/y + 1/z - 1/lcm(x,y) - 1/lcm(y,z) - 1/lcm(x,z) + 1/lcm(x,y,z)

I did not yet find the formula I need to calculate such sums ; I suppose it is possible at least in special cases like the following:
1/ if n is a prime, then p(n) is bigger than any previous value of p(n) (n>1). In fact, the graph of p(n) looks much like 1/tau(n) (the number of divisors of n).

2/ if n has many divisors (e.g. multiples of 6, 12,...), p(n) is "locally minimal"
(usually globally: "Conjecture: if n>10, p(n)=min{p(1),..,p(n)}, then n=0 mod 6")
and gets close to 1/log( n log n ) which I suggest as candidate for its asymptotic behaviour.


[code]
p(n)={ local( P, L, t=[], s=1, last=0 );if(n<2,return(1));
forstep( i=n-1, n/factor(n)[1,1]+1, -1,
L = t; t = [ P = lcm(n,i)/n ];
/* combine with the old list, removing multiples */
for( i=1, #L, if( P >= L[i] && P % L[i] == 0, t=L; s += last; next(2));
if( L[i] % P, t = concat( t, [L[i]] ));
);
if( #L && (gcd(lcm(L), P)==1), last *= (1-1/P); /* speedup */,
P = lcm(t); /* to use integer arithmetics in sum */
last = sum( j=0, 2^#t -1, (-1)^#( L=vecextract( t,j ))*P/lcm(L))/P;
); s+=last;
); s/n
}
[/code]

m_f_h 2007-04-20 15:57

Just for the records...
 
I don't know if anybody is still interested in that, and if my results are completely obsolete in view of the MAGMA code you (A.K.) mentioned.
However, just for the records, before this thread gets completely "archived", let me mention that I had a look at the function

f : powerset(N*) -> Q
f(S) = sum_{A subset S} (-1)^#A / lcm(A)

Example: f({})=1, f({m})=1-1/m, f({m,n})=1-1/m-1/n+1/lcm(m,n),...

This is the function that must be evaluated for S={n,n-1}, {n,n-1,n-2},..., {n,n-1,...,2} to calculate p(n) (= r(n)-r(n-1)).

f has lots of interesting properties which are immediate to show:[LIST][*]if 1\in S, f(S)=0[*]if m=gcd(S)>1 then f(S)=1+( f(S/m)-1)/m[*]f(S) = f(S') if S contains in addition to elements of S' only multiples thereof[*]if p\in S is relatively prime to all other elements of S, then f(S)=(1-1/p) f(S)[*]Corollary: if the elements of S are pairwise coprime, then f(S) = product( 1-1/p, p\in S)[*]Corollary: if S contains the first n primes p_1...p_n (and maybe multiples thereof, in particular any number < p[n+1] and >1), then f(S) = \phi(p_n#) / p_n#
where # is primorial (product of these primes) and \phi is Euler's totient function (OEIS A5876)
Example: f({2,3,4,5})=(2-1)(3-1)(5-1)/(2*3*5) = 4/15.[*]More generally, if S can be partitioned such that elements of different subsets never have a common factor, then f(S) is the product of the f(S_i)[/LIST]I suppose the latter is a known and well studied property (we could call it "multiplicative" in this arithmetical sense), but I never heard of before (sorry for my lack of culture ; I'd appreciate any reference)...
Using such decompositions of S, one can calculate f({n,n-1,n-2,...}) and thus r(n) quite far rather quickly. If someone is interested in, I can post the PARI code.
However, I did not yet have the time to search a formula for
f( {n,n-1,...,k} ) (at least for prime n) - I think it should not be too difficult to find, and with this, calculation of r(n) would be immediate for any n.

For the sake of completeness, I also recall that p(n)=r(n)-r(n-1) takes its maximal values for n prime, then p(n)=1/2+something growing slowly like sqrt(n) or log(n) (at these points r(n)/n increases); and it takes smallest values for highly composite n (something like 1/sigma(n), the sum of divisors of n).

If someone is interested in studying this further (I don't know if this could merit writing a paper...), feel free to contact me.

PS:
There are now also 2 OEIS sequences,
[URL="http://www.research.att.com/%7Enjas/sequences/A101459"]A101459[/URL]
a(k) = card { i*j , i <= k, j <= lcm(1,2,3...,k) }.and
[URL="http://www.research.att.com/%7Enjas/sequences/A126959"]A126959[/URL]
a(k) = k! * lim_{n->oo} card({ i*j; i=1..k, j=1..n })/n.
(The latter is r(n)*n!, the former r(n)*lcm(2,...,n).)

akruppa 2007-04-23 09:44

[QUOTE=m_f_h;104124]I don't know if anybody is still interested in that, and if my results are completely obsolete in view of the MAGMA code you (A.K.) mentioned. [/QUOTE]

I'm certainly following the thread, but I'm afraid I can't put a lot of time into this problem myself atm, so I don't really have anything interesting to add... :sad:

Alex


All times are UTC. The time now is 22:11.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.