mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Miscellaneous Math (https://www.mersenneforum.org/forumdisplay.php?f=56)
-   -   p | f(m,n) (https://www.mersenneforum.org/showthread.php?t=22442)

a1call 2017-07-09 01:35

[QUOTE=science_man_88;462981][TEX]2^{-\infty}\approx 0[/TEX] in theory . I may be wrong there though.[/QUOTE]

That's what I thought too. But Wolfram alpha says none and infinity is not a number so it can't be a solution. Same way 1/0 converges to infinity but can't be equal to it and is addressed as undefined. But that is a can of worms best left to its own thread.

CRGreathouse 2017-07-09 01:43

[QUOTE=a1call;462977]Like I said there are no primorials in the function, but setting m as a primorial would be means of factoring n by GCD. But I am hoping for a more practical use.[/QUOTE]

Functions don't have things "in" them. I think what you're trying to say is that your function can be expressed in closed form without using a symbol for primorial. But for that to make sense you're really going to need to explain what symbols you do allow and how you allow them to be joined. For starters, I assume you allow rational numbers, the field operations (+, -, /, *), and compositions of same. Anything else? Exponentiation, trig functions, other constants?

a1call 2017-07-09 02:23

[QUOTE=CRGreathouse;462985]Functions don't have things "in" them. I think what you're trying to say is that your function can be expressed in closed form without using a symbol for primorial. But for that to make sense you're really going to need to explain what symbols you do allow and how you allow them to be joined. For starters, I assume you allow rational numbers, the field operations ([B]+[/B],[B] -[/B], /, *), and compositions of same. Anything else? [B]Exponentiation[/B], trig functions, other constants?[/QUOTE]
I can write the function using only integers, variables m and n and the bolded operators {()+-^}.
As with many functions there are ranges for the variables that give valid results.

ETA I wonder if a brute force can easily come up with the formula.:smile:

CRGreathouse 2017-07-09 04:53

[QUOTE=a1call;462965]Here are some actual results:

------------------------
m=7;n=11;
valuation(f(m,n),5)=0
------------------------
m=5;n=11;
valuation(f(m,n),5)=1
------------------------
m=7;n=5;
valuation(f(m,n),5)=0
------------------------
m=5;n=5;
valuation(f(m,n),5)=2
------------------------
m=25;n=5;
valuation(f(m,n),5)=3
------------------------
m=5;n=25;
valuation(f(m,n),5)=2
------------------------
m=7;n=25;
valuation(f(m,n),5)=0[/QUOTE]

[QUOTE=a1call;462986]I can write the function using only integers, variables m and n and the bolded operators {()+-^}.
As with many functions there are ranges for the variables that give valid results.[/QUOTE]

Well, from #1 and #2 we can conclude that it must have m in it somewhere, and from #2 and #4 we can conclude that it must have n in it somewhere. If those were the only nulladic operators in the expression it would have to be m+n, m-n, n-m, m^n, or n^m. But it's easy to check that #4 does not hold for any of these, hence the expression has at least three nulladic operators. The third could me another copy of m or n, or else some integer.

[QUOTE=a1call;462986]I wonder if a brute force can easily come up with the formula.:smile:[/QUOTE]

No doubt brute force could come up with some formula meeting your criteria. I don't know that it would be the same one you have in mind, though.

a1call 2017-07-09 18:10

[QUOTE=CRGreathouse;462991]
No doubt brute force could come up with some formula meeting your criteria. I don't know that it would be the same one you have in mind, though.[/QUOTE]

Well, then there would be a good chance that the found formula would have the same characteristics but evaluating to smaller integers than mine, and that would be a good thing.

But the main point off this thread is to discuss if such a function could be utilized in a practical (size not withstanding) factoring algorithm.

So, if there is such a function f(m,n), such that the factors of n can be present in f(m,n) only if they are also present in m (given factors of m will be present regardless and factors of n can increase the valuation by as much as the valuation in n).
Can such a function have uses in factoring. This is a unique behavior that seems of some potential use.

a1call 2017-07-09 19:09

Here is an inefficient (Because forvec() is just too complicated to use [I hoped Pari-GP would have something more ergonomic like Mathematica's foreach]) programmatic equivalence of an ideal such function.:smile:


[CODE]print("\n\nBSL-100-A-p,function-of-m,n.gp\nBy a1call\n")
#

f(m,n)={
theResult =1;
forprime(p=2,m,
theValuationM = valuation(m,p);
theValuationN = valuation(n,p);
if(theValuationN > theValuationM, theValuationN =theValuationM );
theResult =theResult *p^(theValuationM +theValuationM );
);
return(theResult );
}

m=7*19^3
n=11*19^13
valuation(f(m,n),19)[/CODE][CODE]BSL-100-A-p,function-of-m,n.gp
By a1call

timer = 1 (on)
48013
462582818084827649
time = 4 ms.
6
[/CODE]

CRGreathouse 2017-07-09 20:33

[QUOTE=a1call;463022]Here is an inefficient (Because forvec() is just too complicated to use [I hoped Pari-GP would have something more ergonomic like Mathematica's foreach]) programmatic equivalence of an ideal such function.:smile:


[CODE]print("\n\nBSL-100-A-p,function-of-m,n.gp\nBy a1call\n")
#

f(m,n)={
theResult =1;
forprime(p=2,m,
theValuationM = valuation(m,p);
theValuationN = valuation(n,p);
if(theValuationN > theValuationM, theValuationN =theValuationM );
theResult =theResult *p^(theValuationM +theValuationM );
);
return(theResult );
}

m=7*19^3
n=11*19^13
valuation(f(m,n),19)[/CODE][CODE]BSL-100-A-p,function-of-m,n.gp
By a1call

timer = 1 (on)
48013
462582818084827649
time = 4 ms.
6
[/CODE][/QUOTE]

Yes, that's just what I meant in post #13.

science_man_88 2017-07-09 20:38

[QUOTE=a1call;463022]Here is an inefficient (Because forvec() is just too complicated to use [I hoped Pari-GP would have something more ergonomic like Mathematica's foreach]) programmatic equivalence of an ideal such function.:smile:


[CODE]print("\n\nBSL-100-A-p,function-of-m,n.gp\nBy a1call\n")
#

f(m,n)={
theResult =1;
forprime(p=2,m,
theValuationM = valuation(m,p);
theValuationN = valuation(n,p);
if(theValuationN > theValuationM, theValuationN =theValuationM );
theResult =theResult *p^(theValuationM +theValuationM );
);
return(theResult );
}

m=7*19^3
n=11*19^13
valuation(f(m,n),19)[/CODE][CODE]BSL-100-A-p,function-of-m,n.gp
By a1call

timer = 1 (on)
48013
462582818084827649
time = 4 ms.
6
[/CODE][/QUOTE]

the code you posted isn't practically usable in forvec as written anyways.

[CODE]forvec(X = v,seq,{flag = 0}):

Let v be an n-component vector (where n is arbitrary) of two-component vectors [a_i,b_i] for 1 <= i <= n, where all entries a_i, b_i are real numbers. This routine lets X vary over the
n-dimensional hyperrectangle given by v, that is, X is an n-dimensional vector taking successively its entries X[i] in the range [a_i,b_i] with lexicographic ordering. (The component with the hig
index moves the fastest.) The type of X is the same as the type of v: t_VEC or t_COL.[/CODE]

all this really means is for(x=1,3,for(y=1,10,seq)) is approximated by forvec(X=[[1,3],[1,10]],seq) where flag in the mentioned help tells if they should be nondecreasing ([TEX]x\le y[/TEX]),or strictly increasing ([TEX]x\lt y[/TEX])

CRGreathouse 2017-07-09 20:49

A more efficient version:
[code]f(m,n)={
my(g=gcd(m,n), f=factor(g)[,1],p);
prod(i=1,#f, p=f[i]; e=valuation(m,p); p^(e+min(valuation(n,p),e)));
}[/code]

Testing
[code]v=vector(10^4,i,[random(10^6),random(10^6)]);
for(i=1,#v,call(f,v[i]))[/code]
(using the same vector for both calls) takes 2min, 37,589 ms for yours and 20 ms for mine.

a1call 2017-07-09 20:54

Will be back to work tomorrow, so might as well spill the beans now.


f (m,n) = (m+1)^x + (m-1)^y

For integers m,n,x and y.
Where
x + y = n & y and n are both odd integers.



The closer x and y are together the smaller the evaluated function will be, but there is no algebraic way I know of to evaluate them such that x is guaranteed to be even.
So a purely algebraic formula would be:



f (m,n) = (m+1)^4 + (m-1)^(n-4)


For integers m,n
Where
n > 4 & n is odd


All times are UTC. The time now is 14:49.

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