Solve for upperbound of a summation to find the nearest LCM to a given #

  • MHB
  • Thread starter Jaded Dreamking
  • Start date
  • Tags
    Summation
In summary, the conversation discussed finding the LCM of consecutive integers (1-n) and the number of factors in such an LCM. Several methods were presented, such as using Prime Pi and Mangoldt function, as well as various equations and algorithms. There was also mention of the difficulty in deconstructing an LCM to find n and the desire to find the nearest LCM above or below a given value.
  • #1
Jaded Dreamking
1
0
I've been doing some work with finding the LCM of consecutive integers (1-n) and the number of factors in such an LCM.
It's become easy to construct an LCM and find the factors when n is given.
However, to deconstruct a given LCM and find n is proving difficult.
I eventually would like to find the nearest LCM either above or below a value.
It would be nice to have the one above, but I could make due with the one below.

I've been provided with a few ways of doing this that I'd like to show
and see if anyone can show me
how to solve it algebraically or code for my objective.

The first uses Prime Pi.

Product[Prime^Floor[Log[Prime, 11]], {i, PrimePi[11]}]

Out: 27720

Product[Floor[1 + Log[Prime, 11]], {i, PrimePi[11]}]

Out: 96

Also, I'd like to note that if PrimePi[] exceeds the value of n (11), then it does not affect the outcome.
And for some reason, the "" would not copy and paste behind Prime. I had to enter that manually. A bug perhaps?
And my computer let me know :
"The Mathematica command giving the prime counting function for a \ number x is PrimePi[x], which works up to a maximum value of x approx 8*10^(13)."

The second uses the Mangoldt function to construct the LCM.

Product[E^MangoldtLambda[n],{n, 2, 11}]

Out: 27720

and then using DivisorSigma [0,LCM] to find divisors / factors :

DivisorSigma[0, Product[E^MangoldtLambda[n],{n, 2, 11}]]and then there's what I refer to as the Apply method:

Apply[LCM, Range[11]]

and then I use DivisorSigma with that like this:

DivisorSigma[0, Apply[LCM, Range[11]]]

and then there's what I refer to as the PrimeQ method for which I only know how to find factors with given n:

Times @@ Map[Floor[1 + Log[#, 11]] &, Select[Range[2, 11], PrimeQ]]

and then there's the Cyclotomic method

Product[Cyclotomic[n, 1],{n, 2, 11}]I've read a couple of equations that I haven't been able to implement in mathematica

One webpage said that the LCM of (1-n) is equal to

E^(n*(1 + \[Omicron]*1))

which is too high of math for me to understand.

Another one out of my reach is: Psi(x) = ln (1,2,3,...,x)
If not psi, then it might be a similar symbol like PolyGamma
I figured that I could then take e^Psi(x) to get the LCM of (1-n).

I estimated that the target objective, the LCM of (1-n) that is somewhere near 10^(10^10) :

Floor[1+Log10[LCM@@Range[2297]]]//AbsoluteTiming

{0.0156250,1000}

Floor[1+Log10[LCM@@Range[23013]]]//AbsoluteTiming

{0.1406250,9998}

Floor[1+Log10[LCM@@Range[230075]]]//AbsoluteTiming

{2.6406250,99997}

Floor[1+Log10[LCM@@Range[2302149]]]//AbsoluteTiming

{63.7500000,999997}

Floor[1+Log10[Floor[1+Log10[LCM@@Range[23021490000]]]]]//AbsoluteTiming

And this last bit of code I have tried to run overnight and my 32 bit confuser didn't give.

My last thought was that since log_a(xy) = log_a(x) + log_a(y), then I need to solve for n where:

Sum of Log_10(e^(MangoldtLambda(n))) => (10^10). I tried:

NSolve[[[\!\(\*UnderoverscriptBox[\(\\), \(x = 2\), \(\\)]\(Floor[1 + Log10[\([E^MangoldtLambda[x], {x, 2, \}]\)]]\)\)] >= 10^10], x]

but the code isn't working for me.:confused:
 
Physics news on Phys.org
  • #2
Jaded Dreamking said:
I've been doing some work with finding the LCM of consecutive integers (1-n) and the number of factors in such an LCM.
It's become easy to construct an LCM and find the factors when n is given.
However, to deconstruct a given LCM and find n is proving difficult.
I eventually would like to find the nearest LCM either above or below a value.
It would be nice to have the one above, but I could make due with the one below.

I've been provided with a few ways of doing this that I'd like to show
and see if anyone can show me
how to solve it algebraically or code for my objective.

The first uses Prime Pi.

Product[Prime^Floor[Log[Prime, 11]], {i, PrimePi[11]}]

Out: 27720

Product[Floor[1 + Log[Prime, 11]], {i, PrimePi[11]}]

Out: 96

Also, I'd like to note that if PrimePi[] exceeds the value of n (11), then it does not affect the outcome.
And for some reason, the "" would not copy and paste behind Prime. I had to enter that manually. A bug perhaps?
And my computer let me know :
"The Mathematica command giving the prime counting function for a \ number x is PrimePi[x], which works up to a maximum value of x approx 8*10^(13)."

The second uses the Mangoldt function to construct the LCM.

Product[E^MangoldtLambda[n],{n, 2, 11}]

Out: 27720

and then using DivisorSigma [0,LCM] to find divisors / factors :

DivisorSigma[0, Product[E^MangoldtLambda[n],{n, 2, 11}]]and then there's what I refer to as the Apply method:

Apply[LCM, Range[11]]

and then I use DivisorSigma with that like this:

DivisorSigma[0, Apply[LCM, Range[11]]]

and then there's what I refer to as the PrimeQ method for which I only know how to find factors with given n:

Times @@ Map[Floor[1 + Log[#, 11]] &, Select[Range[2, 11], PrimeQ]]

and then there's the Cyclotomic method

Product[Cyclotomic[n, 1],{n, 2, 11}]I've read a couple of equations that I haven't been able to implement in mathematica

One webpage said that the LCM of (1-n) is equal to

E^(n*(1 + \[Omicron]*1))

which is too high of math for me to understand.

Another one out of my reach is: Psi(x) = ln (1,2,3,...,x)
If not psi, then it might be a similar symbol like PolyGamma
I figured that I could then take e^Psi(x) to get the LCM of (1-n).

I estimated that the target objective, the LCM of (1-n) that is somewhere near 10^(10^10) :

Floor[1+Log10[LCM@@Range[2297]]]//AbsoluteTiming

{0.0156250,1000}

Floor[1+Log10[LCM@@Range[23013]]]//AbsoluteTiming

{0.1406250,9998}

Floor[1+Log10[LCM@@Range[230075]]]//AbsoluteTiming

{2.6406250,99997}

Floor[1+Log10[LCM@@Range[2302149]]]//AbsoluteTiming

{63.7500000,999997}

Floor[1+Log10[Floor[1+Log10[LCM@@Range[23021490000]]]]]//AbsoluteTiming

And this last bit of code I have tried to run overnight and my 32 bit confuser didn't give.

My last thought was that since log_a(xy) = log_a(x) + log_a(y), then I need to solve for n where:

Sum of Log_10(e^(MangoldtLambda(n))) => (10^10). I tried:

NSolve[[[\!\(\*UnderoverscriptBox[\(\\), \(x = 2\), \(\\)]\(Floor[1 + Log10[\([E^MangoldtLambda[x], {x, 2, \}]\)]]\)\)] >= 10^10], x]

but the code isn't working for me.:confused:


Programming in Mathematica is doable, but I think more difficult than say Python or if you prefer Matlab. I think for what you are looking to do Python may be the way to go; otherwise, you should ask this question on Mathematica Stackexchange since Mathematica programming experts can be found there. I am not trying to detract from MHB but this question may linger a lot longer here compared to there.
 

1. What is an upperbound?

An upperbound is the largest possible value that a summation or series can reach. It is often used in mathematical equations to set a limit or boundary for a given problem.

2. What is a summation?

A summation is a mathematical operation that involves adding a series of numbers or terms together. It is often represented using the Greek letter sigma (Σ) and the upper and lower bounds of the summation are denoted above and below the sigma respectively.

3. How do you find the nearest LCM to a given number?

To find the nearest LCM (least common multiple) to a given number, you need to first find the factors of the given number. Then, you can use these factors to determine the LCM by finding the smallest set of factors that are common to all of the given numbers. This will give you the nearest LCM to the given number.

4. Why is it important to find the nearest LCM to a given number?

Finding the nearest LCM to a given number is important because it allows you to simplify fractions, add and subtract fractions with different denominators, and solve equations involving fractions. It is also used in various real-life applications such as scheduling, budgeting, and measurements.

5. Can you provide an example of solving for the upperbound of a summation to find the nearest LCM to a given number?

Yes, for example, if we want to find the nearest LCM to the number 18, we first find the factors of 18 which are 2, 3, and 3. Then, we can use these factors to write the summation as 2^a * 3^b * 3^c, where a, b, and c are the upper bounds for the summation. By solving for the upper bounds, we get a = 1, b = 1, and c = 2, giving us the nearest LCM of 18 as 2^1 * 3^1 * 3^2 = 36.

Similar threads

  • General Math
Replies
1
Views
570
  • Advanced Physics Homework Help
Replies
24
Views
830
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
874
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • Programming and Computer Science
Replies
9
Views
1K
  • Advanced Physics Homework Help
Replies
3
Views
895
  • Engineering and Comp Sci Homework Help
Replies
32
Views
3K
Replies
6
Views
1K
Back
Top