Tired of seeing ads? Click here to upgrade to Elite Membership!


Mathematics Forum

Reply  New Topic New Poll Mathematics -> Number Theory
Control Panel | search | Email to a Friend
Log In! | Register

Author Message / Information
Euler






Quote | Reply |


A little help...
posted on: 6/14/2006 5:20:28 PM

Can anybody here help me write a program which would return all the values of x, for a given array (set) of values for y which satisfy the equation below:

y=(pi)^x???

It would be greatly appreciated!
The Riemann Hypothesis




Quote | Reply |


A little help...
replied on: 6/17/2006 7:44:01 AM

quote:
Can anybody here help me write a program which would return all the values of x, for a given array (set) of values for y which satisfy the equation below:

y=(pi)^x???

It would be greatly appreciated!



So you have values of y and you need to find x? Shouldn't:

int main(){
int I = 0;
int yarray[n];
// Code to fill yarray with y values

int xarray[n;
Do{

xarray = ln(y) / ln(pi);

I += 1;
} while(x < n);
return 0;
}

work? That assumes that there is one solution for y = pi^x though. I'm not sure if there is more than 1 solution.




Euler




Quote | Reply |


A little help...
replied on: 6/17/2006 10:30:20 PM

Yes that would definitely work; however, I am not all that well versed in programming, so can I simply type ln and pi in the code and it will know what to do, and if so, is there some preprocessor directive I need to call?
The Riemann Hypothesis




Quote | Reply |


A little help...
replied on: 6/23/2006 6:52:46 AM

#include <math.h>

int main(){
int I = 0;
int yarray[n];
const double pi = 3.141592654
// Code to fill yarray with y values
yarray[0] = y value you want
yarray[1] = another y value you want
yarray[2] = ....etc



int xarray[n];
Do{

xarray = log(y) / log(pi);

I += 1;
} while(x < n);

return 0;
}


that c++ code will put it into the array xarray. Pi you have to define as a constant. Using #include <math.h> will allow you to use the log(n) command. log(n) is the natural logarithm of n.
Euler




Quote | Reply |


A little help...
replied on: 6/23/2006 7:07:03 PM

Thank you very much, though I already figured it out for myself. Thanks again though!
LinkBot





Gamers Wanted is looking for people to write game reviews and post news,
if your interested please visit Gamers Wanted About Us Page




 



Contact Administrator (must be logged in)


Tired of seeing ads? Click here to upgrade to Elite Membership!


ChatArea.com Help & News Forums | Terms of Use | Contact ChatArea.com | Advertising

Powered By ChatArea.com - Get your free Society today! © Copyright 2003 Wewp!