Re: [algogeeks] Re: Power(n^n)

2012-06-14 Thread Prakhar Jain
Typo in this problem statement.

K is not less than or equal to 1000.
Only N=1000.
K can be as big as 1000^1000,i.e. 1000 digits.


-- 
Prakhar Jain
IIIT Allahabad
B.Tech IT 3rd Year
Mob no: +91 9454992196
E-mail: rit2009...@iiita.ac.in
  jprakha...@gmail.com



On Tue, Jun 12, 2012 at 12:27 PM, hary rathor harry.rat...@gmail.comwrote:

 there would no problem of rang if

  K^(1/N)==N



  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-12 Thread hary rathor
there would no problem of rang if

 K^(1/N)==N

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-11 Thread Guneesh Paul Singh
@abhisheikh read the problem statement again...it says 1000 digits not 1000
value..

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-11 Thread saurabh singh
@Guneesh Actually he says But 0=N , K=1000 so N^N could be have 1000
digits. I think this assertion is wrong..
@dave sir.. The second part of question still remains unanswered.Is there
any mathematical property...
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com



On Mon, Jun 11, 2012 at 1:56 PM, Guneesh Paul Singh gunees...@gmail.comwrote:

 @abhisheikh read the problem statement again...it says 1000 digits not
 1000 value..


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-11 Thread rammar
@Guneesh
But 0=N , K=1000 so N^N could be have 1000 digits. 

There is no direct upper bound on N, but there is an upper bound on K (i.e. 
K = 1000).
And we need to check N^N == K, so N^N cant be more than 1000.

On Monday, June 11, 2012 1:56:13 PM UTC+5:30, Guneesh wrote:

 @abhisheikh read the problem statement again...it says 1000 digits not 
 1000 value..



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/dswHt9ucfDEJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-11 Thread Dave
@Bashrc: The mathematical property is as I gave it: 0 = N = 4.
 
Dave

On Monday, June 11, 2012 4:43:21 AM UTC-5, .bashrc wrote:

 @Guneesh Actually he says But 0=N , K=1000 so N^N could be have 1000 
 digits. I think this assertion is wrong..
 @dave sir.. The second part of question still remains unanswered.Is there 
 any mathematical property...
 Saurabh Singh
 B.Tech (Computer Science)
 MNNIT 
 blog:geekinessthecoolway.blogspot.com



 On Mon, Jun 11, 2012 at 1:56 PM, Guneesh Paul Singh 
 gunees...@gmail.comwrote:

 @abhisheikh read the problem statement again...it says 1000 digits not 
 1000 value..


  -- 
 You received this message because you are subscribed to the Google Groups 
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to 
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/algogeeks?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/KjF7UEfNtwAJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-08 Thread Abhishek Sharma
You don't need to use BigNum or long int for this program.
Both n  k should be less than 1000.
Since there is no restriction on k,you don't need Bignum
Since both n,k are restricted,you don't need bignum.
if n5, simply reject the input and return false


On Fri, Jun 8, 2012 at 11:01 AM, Dave dave_and_da...@juno.com wrote:

 @victor: But if K = 1000, then the largest N you have to deal with is 4,
 since 4^4  1000 but 5^5  1000. So your code looks like this:

 int IsNtoNEqualK( int N, int K)
 {
 return (N==1)(K==1) || (N==2)(K==4) || (N==3){K==27) ||
 (N==4)(K==256);
 }


 On Thursday, June 7, 2012 5:14:00 PM UTC-5, Victor Manuel Grijalva
 Altamirano wrote:

 Hi, everybody!!!
 I have the follow quest...

 I have two numbers N and K,  i need to check that N^N = K.
 for example:
   if N=2 and K=4 , 2^2 = 4 so return true;
   if N=3 and K=26 ,   3^3 != 26 so return false
 But 0=N , K=1000 so N^N could be have 1000 digits.

 I program in C++, and i can use Bignum (array manipulation) + fast
 power(binary power) but i want to know if exist a mathematical property.


 --
 Victor Manuel Grijalva Altamirano
 Universidad Tecnologica de La Mixteca

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/s6ahKx0Sxe8J.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Abhishek Sharma
Under-Graduate Student,
PEC University of Technology

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Power(n^n)

2012-06-08 Thread Abhishek Sharma
Ignore the last post.
Updated:
You don't need to use BigNum or long int for this program.
Both n  k should be less than 1000.
you need bignum only if there would be no restriction on k.
Since both n,k are restricted, you don't need bignum.
if n5( 5^5  1000), simply reject the input and return false


On Fri, Jun 8, 2012 at 11:49 AM, Abhishek Sharma abhi120...@gmail.comwrote:

 You don't need to use BigNum or long int for this program.
 Both n  k should be less than 1000.
 Since there is no restriction on k,you don't need Bignum
 Since both n,k are restricted,you don't need bignum.
 if n5, simply reject the input and return false


 On Fri, Jun 8, 2012 at 11:01 AM, Dave dave_and_da...@juno.com wrote:

 @victor: But if K = 1000, then the largest N you have to deal with is 4,
 since 4^4  1000 but 5^5  1000. So your code looks like this:

 int IsNtoNEqualK( int N, int K)
 {
 return (N==1)(K==1) || (N==2)(K==4) || (N==3){K==27) ||
 (N==4)(K==256);
 }


 On Thursday, June 7, 2012 5:14:00 PM UTC-5, Victor Manuel Grijalva
 Altamirano wrote:

 Hi, everybody!!!
 I have the follow quest...

 I have two numbers N and K,  i need to check that N^N = K.
 for example:
   if N=2 and K=4 , 2^2 = 4 so return true;
   if N=3 and K=26 ,   3^3 != 26 so return false
 But 0=N , K=1000 so N^N could be have 1000 digits.

 I program in C++, and i can use Bignum (array manipulation) + fast
 power(binary power) but i want to know if exist a mathematical property.


 --
 Victor Manuel Grijalva Altamirano
 Universidad Tecnologica de La Mixteca

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/s6ahKx0Sxe8J.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Abhishek Sharma
 Under-Graduate Student,
 PEC University of Technology




-- 
Abhishek Sharma
Under-Graduate Student,
PEC University of Technology

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Power(n^n)

2012-06-07 Thread Dave
@victor: But if K = 1000, then the largest N you have to deal with is 4, 
since 4^4  1000 but 5^5  1000. So your code looks like this:
 
int IsNtoNEqualK( int N, int K)
{
return (N==1)(K==1) || (N==2)(K==4) || (N==3){K==27) || 
(N==4)(K==256);
}
 

On Thursday, June 7, 2012 5:14:00 PM UTC-5, Victor Manuel Grijalva 
Altamirano wrote:

 Hi, everybody!!!
 I have the follow quest... 

 I have two numbers N and K,  i need to check that N^N = K.
 for example:
   if N=2 and K=4 , 2^2 = 4 so return true;
   if N=3 and K=26 ,   3^3 != 26 so return false
 But 0=N , K=1000 so N^N could be have 1000 digits.

 I program in C++, and i can use Bignum (array manipulation) + fast 
 power(binary power) but i want to know if exist a mathematical property.  


 -- 
 Victor Manuel Grijalva Altamirano
 Universidad Tecnologica de La Mixteca


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/s6ahKx0Sxe8J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.