mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2008-01-13, 11:10   #1
nibble4bits
 
nibble4bits's Avatar
 
Nov 2005

2×7×13 Posts
Default Fun one?

f(x) = x*(x/2)*(x/4)*(x/8)*(x/16)*(x/32)*...*(x/a) ; x >= a >= x/2
f(0)=0
f(1)=1
f(2)=2
f(3)=3*1.5=4.5
f(4)=4*2=8
f(5)=5*2.5*1.25=
f(6)=6*3*1.5=
f(7)=7*3.5*1.75=
f(8)=8*4*2=64
f(9)=9*4.5*2.25*1.125
f(10)=10*5*2.5*1.25=
f(11)=11*5.5*2.25*1.125=
f(12)=12*6*3*1.5=108
f(13)=13*6.5*3.25*1.625=
f(14)=14*7*3.5*1.75=
f(15)=15*7.5*3.75*1.875=
f(16)=16*8*4*2=1024


If g(x)=ln f(x)/ln 2, every power of 2 for x gives 2^n times as large an answer as g of the previous power of 2.
Represented in binary, the last term in the product (which is x/a) is just x right-shifted by one less than the position of the highest one bit in x.
This makes f(x) and g(x) useful in finding the binary log of x. Otherwise these two are useless properties, but still interesting on their own.

Hmm should I fill in the missing decimals later?
A followup question: What are some optimized methods to calculate f(x) and g(x)? Are they any better than a shift and compare? Why/Why not? Yes, this is more of a programmer's thread.
nibble4bits is offline   Reply With Quote
Old 2008-01-14, 23:26   #2
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

22×1,549 Posts
Default

I have no idea what you are asking here but I think f(0)=undefined. The last term, x/a, gives 0/0
retina is offline   Reply With Quote
Old 2008-01-16, 16:57   #3
nibble4bits
 
nibble4bits's Avatar
 
Nov 2005

18210 Posts
Default

f(0)=0 because there's no further way to reduce it. The value for a is not 0, it's 2^0=1.
x/a=0 works because 0/1=0
f(0)=(0/1) * no other values=0
f(1)=(1/1) * no other values=1
f(2)=(2/1)*(2/2)=2

I should have explained that better, hehe. The function is meant to lie between x^1 and x^x. There are literally an infinite number of functions that qualify for that description. x^1 and x^x are also known as the first and second hyperpowers of x. I believe the term commonly used is hypersquare for x^x. Since there are an infinite number of hyperpowers between 1 and 2, the statement is true.
A hyperpower 4 of x for example: x^^4=x^(x^(x^x))
Note that there is not an exactly known solution for all hyperpowers. x^^2.442 would not have a trivial solution like x^^4 does. You have to use an numeric approximation. :/

Try this: You have x!! which is defined as x(x-2)(x-4)(x-6)(x-8)...
You know that x! is always greater than or equal to x!!, for x being a positive integer, just by looking at the terms. Make other functions between x and x^x. f(x)=x^2, f(x)=x^(x-1), etc.
nibble4bits is offline   Reply With Quote
Old 2008-01-16, 17:13   #4
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

22×1,549 Posts
Default

Quote:
Originally Posted by nibble4bits View Post
f(0)=0 because there's no further way to reduce it. The value for a is not 0, it's 2^0=1.
x/a=0 works because 0/1=0
f(0)=(0/1) * no other values=0
But earlier you said:
Quote:
f(x) = x*(x/2)*(x/4)*(x/8)*(x/16)*(x/32)*...*(x/a) ; x >= a >= x/2
So if x >= a >= x/2 then when x=0, a must also be 0; therefore your above comment "x/a=0 works because 0/1=0" should be "x/a=??? notworks because 0/0=undefined"
retina is offline   Reply With Quote
Old 2008-01-22, 00:39   #5
nibble4bits
 
nibble4bits's Avatar
 
Nov 2005

B616 Posts
Default

I see what you mean, but I should have qualified it by saying that it's possible to not divide by 'a' at all. To be more specific in programmer's terms, this 'loop' must not run the first time if 'x <= 1' is true. I really need to be careful when glossing over something like that. Sorry about that!

I believe this code snippet would make things clearer if you know some C/C++ as it's just a conditional loop:
workValue = x;
returnValue = x;
a = 1;
if(x > 1) while ((workValue <= 1) && (workValue > 0)){
workValue = workValue/(2^a); // Could use x >> a but it usually only supports integers. This is by design.
returnValue = returnValue * workValue;
a++;
}

Last fiddled with by nibble4bits on 2008-01-22 at 00:43
nibble4bits is offline   Reply With Quote
Reply



All times are UTC. The time now is 02:24.


Sat Jul 17 02:24:14 UTC 2021 up 50 days, 11 mins, 1 user, load averages: 1.44, 1.29, 1.25

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.