For Neopets ONLY discussion.
Topic locked

Lenny Conundrum #117

Wed May 18, 2005 9:05 pm

Congratulations! You have guessed correctly in the Lenny Conundrum game (Round 116). We have given you a Count Von Roo Pinata, an Avatar, and 277 NP!


still no gold upgrade for me..

Wed May 18, 2005 9:29 pm

Darnit, I didn't even get the pinata... guess this one was easier than I thought.

Anyways, for any who might find it interesting, this was what I did:

#include <iostream.h>
#include <math.h>

int sumNums(int i);

void main(void)
{
for(int i=100000; i<=999999; i++)
{
if((pow(i , 1.0/2.0)) - int(pow(i , 1.0/2.0)) == 0 && (pow(i , 1.0/3.0) - int(pow(i , 1.0/3.0)) == 0) && sumNums(i) == 43)
{
cout << i << endl;
}

else if((pow(i , 1.0/2.0) - int(pow(i , 1.0/2.0)) == 0) && (i < 500000) && sumNums(i) == 43)
{
cout << i << endl;
}

else if((pow(i , 1.0/3.0) - int(pow(i , 1.0/3.0)) == 0) && (i < 500000) && sumNums(i) == 43)
{
cout << i << endl;
}
}


//int i = 234578;
//cout << i % 10 << "\t" << ((i % 100) - (i % 10)) / 10 << "\t" << ((i % 1000) - (i % 100)) / 100 << "\t";
//cout << ((i % 10000) - (i % 1000)) / 1000 << "\t" << ((i % 100000) - (i % 10000)) / 10000 << "\t" << ((i % 1000000) - (i % 100000)) / 100000 << endl;
//cout << (i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000) << endl;
//cout << sumNums(i) << endl;

//if((i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000) == 43)
}

int sumNums(int i)
{
return ((i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000));
}


(Shrunk to reduce size)

It looks sloppy, but it works fine and dandy. :)

Re: Lenny Conundrum #117

Wed May 18, 2005 9:36 pm

apranum wrote:Congratulations! You have guessed correctly in the Lenny Conundrum game (Round 116). We have given you a Count Von Roo Pinata, an Avatar, and 277 NP!


still no gold upgrade for me..


I didn't realize the prize item was Count Von Roo Pinata :P guess I was preoccupied with the calculations instead :D

Wed May 18, 2005 11:31 pm

_B4U_ wrote:Darnit, I didn't even get the pinata... guess this one was easier than I thought.

Anyways, for any who might find it interesting, this was what I did:

#include <iostream.h>
#include <math.h>

int sumNums(int i);

void main(void)
{
for(int i=100000; i<=999999; i++)
{
if((pow(i , 1.0/2.0)) - int(pow(i , 1.0/2.0)) == 0 && (pow(i , 1.0/3.0) - int(pow(i , 1.0/3.0)) == 0) && sumNums(i) == 43)
{
cout << i << endl;
}

else if((pow(i , 1.0/2.0) - int(pow(i , 1.0/2.0)) == 0) && (i < 500000) && sumNums(i) == 43)
{
cout << i << endl;
}

else if((pow(i , 1.0/3.0) - int(pow(i , 1.0/3.0)) == 0) && (i < 500000) && sumNums(i) == 43)
{
cout << i << endl;
}
}


//int i = 234578;
//cout << i % 10 << "\t" << ((i % 100) - (i % 10)) / 10 << "\t" << ((i % 1000) - (i % 100)) / 100 << "\t";
//cout << ((i % 10000) - (i % 1000)) / 1000 << "\t" << ((i % 100000) - (i % 10000)) / 10000 << "\t" << ((i % 1000000) - (i % 100000)) / 100000 << endl;
//cout << (i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000) << endl;
//cout << sumNums(i) << endl;

//if((i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000) == 43)
}

int sumNums(int i)
{
return ((i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000));
}


(Shrunk to reduce size)

It looks sloppy, but it works fine and dandy. :)


Your add up the digits looks about as ugly as my add up the digits formula I used in EXCEL. :)

But again, we weren't being graded on the way we got the answer ... just the answer.

It's too bad people spilled the beans on the boards on this one. The payout could have been much better. No item prize for me, either. I need to figure out a way to be notified when the new LC or MP is up. :)

Thu May 19, 2005 5:53 am

XenaAndGabrielle wrote:
_B4U_ wrote:Darnit, I didn't even get the pinata... guess this one was easier than I thought.

Anyways, for any who might find it interesting, this was what I did:

#include <iostream.h>
#include <math.h>

int sumNums(int i);

void main(void)
{
for(int i=100000; i<=999999; i++)
{
if((pow(i , 1.0/2.0)) - int(pow(i , 1.0/2.0)) == 0 && (pow(i , 1.0/3.0) - int(pow(i , 1.0/3.0)) == 0) && sumNums(i) == 43)
{
cout << i << endl;
}

else if((pow(i , 1.0/2.0) - int(pow(i , 1.0/2.0)) == 0) && (i < 500000) && sumNums(i) == 43)
{
cout << i << endl;
}

else if((pow(i , 1.0/3.0) - int(pow(i , 1.0/3.0)) == 0) && (i < 500000) && sumNums(i) == 43)
{
cout << i << endl;
}
}


//int i = 234578;
//cout << i % 10 << "\t" << ((i % 100) - (i % 10)) / 10 << "\t" << ((i % 1000) - (i % 100)) / 100 << "\t";
//cout << ((i % 10000) - (i % 1000)) / 1000 << "\t" << ((i % 100000) - (i % 10000)) / 10000 << "\t" << ((i % 1000000) - (i % 100000)) / 100000 << endl;
//cout << (i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000) << endl;
//cout << sumNums(i) << endl;

//if((i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000) == 43)
}

int sumNums(int i)
{
return ((i % 10) + (((i % 100) - (i % 10)) / 10) + (((i % 1000) - (i % 100)) / 100) + (((i % 10000) - (i % 1000)) / 1000) + (((i % 100000) - (i % 10000)) / 10000) + (((i % 1000000) - (i % 100000)) / 100000));
}


(Shrunk to reduce size)

It looks sloppy, but it works fine and dandy. :)


Your add up the digits looks about as ugly as my add up the digits formula I used in EXCEL. :)

But again, we weren't being graded on the way we got the answer ... just the answer.

It's too bad people spilled the beans on the boards on this one. The payout could have been much better. No item prize for me, either. I need to figure out a way to be notified when the new LC or MP is up. :)


Xena,my friend keeps on refreshing the news page for latest news :D sounds crazy but true.I don't do that simply because I don't have the time to do so - work!

Thu May 19, 2005 2:14 pm

I'm furious! :x After all that hard work, I didn't get ANYTHING!!! :x

What the heck?!?!? :x
Last edited by LupetyLupe on Thu May 19, 2005 2:24 pm, edited 1 time in total.

Thu May 19, 2005 2:21 pm

LupetyLupe wrote:I'm furious! :x After all that hard work, I didn't get ANYTHING!!! :x

I put -edited- because:

1)It's a square
2)It's under 500000
3)Numbers add to 43

What the heck?!?!? :x


That's what i put as well, and haven't gotten anything. However, I just went to the LC page and for me it isn't closed yet, maybe there is a glitch somewhere and we get the NPs when the news comes out. Maybe they are too preoccupied with the upcoming war and haven't dished out all the prizes yet and not closed the competition in some countries.

Thu May 19, 2005 2:24 pm

Oh my gosh! You're right! :o

QUICK!!!!!!!!! EDIT!!!!!!!!!

Thu May 19, 2005 4:25 pm

I got it, LupetyLupe. :) I wonder why it looks like the answer box is still open? O.o Even if someone submitted the answer now, the prizes are already out and it's been judged. (according to the first post)

Thu May 19, 2005 6:43 pm

New One is out!

----
First, take the number of shops in Brightvale. Multiply that by the number of different cards in the Curse of Maraqua TCG set. Then multiply by the number of different "food" colours you can paint a Chia. Finally, multiply the whole thing by the number of prime numbers between one and a million that become a perfect square if you add 1 to them.

Thu May 19, 2005 6:48 pm

:S I wrote a program to find all the prime numbers, but I don't know how to do the "add one" part.

Thu May 19, 2005 6:59 pm

o_0 wrote::S I wrote a program to find all the prime numbers, but I don't know how to do the "add one" part.


I've come up with 78,499 different primes between 1 and 1 million.
Can anyone else confirm this number with me?

Thu May 19, 2005 7:11 pm

XenaAndGabrielle wrote:
o_0 wrote::S I wrote a program to find all the prime numbers, but I don't know how to do the "add one" part.


I've come up with 78,499 different primes between 1 and 1 million.
Can anyone else confirm this number with me?


I believe I got that number, or at least something similar to it.

Thu May 19, 2005 7:38 pm

o_0 wrote:
XenaAndGabrielle wrote:
o_0 wrote::S I wrote a program to find all the prime numbers, but I don't know how to do the "add one" part.


I've come up with 78,499 different primes between 1 and 1 million.
Can anyone else confirm this number with me?


I believe I got that number, or at least something similar to it.


similar to it wasn't exactly the confirmation I was looking for. ;) I'll hope it was right.

Edit: Darn, I missed a Food Chia. Looks like I will get the answer wrong. :( Who knows ... they will probably decide to count "snot" or "snow" as a food ... just to decrease the payout.

Thu May 19, 2005 8:49 pm

bah, a research question.
Topic locked