Trurl Posted January 24 Author Share Posted January 24 The problem is it is Sqrt[(x^3*pnp^3)/(x^3*pnp+x)-pnp Where pnp is the constant SemiPrime. 2564855351 in this case x is the value on the axis. Where y on the graph equals zero, x approaches the smaller SemiPrime. I believe in your graphs y is variable. I am working on testing the program. But if you take p = 2564855351; x = 3; Monitor[While[x <= p, If[(Sqrt[p^3/(p*x^2 + x)] - p) < 0.5, Print[x]; Break[];]; x += 2;]; and display x when it breaks it should be within range of the smaller Prime factor. I know testing sounds simple enough but my computers and software are aging. Software upgrades faster than I do. All my software is scattered across 5 computers. And I don’t think Win7 and XP systems are safe on the internet. But that is just my computer maintenance problems. Hope this helps. Link to comment Share on other sites More sharing options...
Trurl Posted January 24 Author Share Posted January 24 p = 2564855351; x = 3; Monitor[While[x <= p, If[(Sqrt[p^3/(p*x^2 + x)] - p) < 0.5, Print[x]; Break[];]; x += 2;]; Syntax error. Should read: p = 2564855351; x = 3; Monitor[While[x <= p, If[x*(Sqrt[p^3/(p*x^2 + x)]) - p) < 0.5, Print[x]; Break[];]; x += 2;]; That is why it wasn’t working. It was y, the second Prime factor. But we would have no way of knowing when y was reached. Multiple y by x to get p. Subtract p and the y of graph equal to zero. That y intercept is where x approaches the value of the smaller Prime factor. Link to comment Share on other sites More sharing options...
Ghideon Posted January 25 Share Posted January 25 On 1/24/2024 at 9:06 PM, Trurl said: and display x when it breaks it should be within range of the smaller Prime factor. What does "within range" mean? 23 hours ago, Trurl said: That y intercept is where x approaches the value of the smaller Prime factor. What do you mean by "approaches"? Link to comment Share on other sites More sharing options...
Trurl Posted January 26 Author Share Posted January 26 Well leaving out the x was a happy accident. It just shows again x times y = p and we are just using algebra. 4 hours ago, Ghideon said: What does "within range" mean? That is why the second part of the program used division. The first algorithm found where x value of the small factor approached zero value at y. I put the value of y at p minus x times y so it is easier to find. I could have said x at factor and y equals pnp. I said within range because there is some error with x. It is close but within error. 4 hours ago, Ghideon said: What do you mean by "approaches”? The equation is too complex to solve for x even though it has x as the only unknown. I say approaches because I am plugging in a test value of x to find y. That is why I graphed it. I know it is not pretty math and is more of a hack. But using test values you know the area of the factors because the further away the y value on the graph is from zero the further away you are from the factor. Link to comment Share on other sites More sharing options...
Ghideon Posted January 27 Share Posted January 27 Your descriptions do not match program code you have posted. What program do you try to describe? Link to comment Share on other sites More sharing options...
Trurl Posted January 27 Author Share Posted January 27 p = 2564855351; x = 3; Monitor[While[x <= p, If[(Sqrt[p^3/(p*x^2 + x)] - p) < 0.5, Print[x]; Break[];]; x += 2;]; If[x <= p, While[x <= p, If[Divisible[p, x], Print[x]; Break[];]; x += 2;];], x] First function corrected: p = 2564855351; x = 3; Monitor[While[x <= p, If[x*(Sqrt[p^3/(p*x^2 + x)]) - p) < 0.5, Print[x]; Break[];]; x += 2; Same as all my recent descriptions. Link to comment Share on other sites More sharing options...
Ghideon Posted January 28 Share Posted January 28 Your code does not seem syntactically correct. 12 hours ago, Trurl said: p = 2564855351; x = 3; Monitor[While[x <= p, If[(Sqrt[p^3/(p*x^2 + x)] - p) < 0.5, Print[x]; Break[];]; x += 2;]; If[x <= p, While[x <= p, If[Divisible[p, x], Print[x]; Break[];]; x += 2;];], x] First function corrected: p = 2564855351; x = 3; Monitor[While[x <= p, If[x*(Sqrt[p^3/(p*x^2 + x)]) - p) < 0.5, Print[x]; Break[];]; x += 2; Same as all my recent descriptions. Link to comment Share on other sites More sharing options...
Trurl Posted January 29 Author Share Posted January 29 p = 2564855351; x = 3; Monitor[While[x <= p, If[(x*(Sqrt[p^3/(p*x^2 + x)]) - p) < 0.5, Print[x]; Break[];]; x += 2; Missing parentheses, but the logic is there. The language is Mathematica. I collaborated with another Mathematica coder. I’m not familiar with the “Monitor” class. But this class is the representation of everything I have posted. If it is the syntax I will have to consult more Mathematica coders. Attention all coders!!! Link to comment Share on other sites More sharing options...
Trurl Posted January 31 Author Share Posted January 31 This code works!!!!!!! Working Mathematica Code: Clear[x,p]; p=2564855351; x=3; Monitor[While[x<p, If[(x*(Sqrt[p^3/(p*x^2+x)])-p)<0.5, Print[x]; Break[];]; x+=2;]; If [x <= p, While[x<p, If[Divisible[p,x], Print[x]; Break[];]; x +=2;];], x] 3 41227 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now