Wed May 18, 2005 9:05 pm
Wed May 18, 2005 9:29 pm
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..
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.
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.
Thu May 19, 2005 2:14 pm
Thu May 19, 2005 2:21 pm
LupetyLupe wrote:I'm furious!After all that hard work, I didn't get ANYTHING!!!
![]()
I put -edited- because:
1)It's a square
2)It's under 500000
3)Numbers add to 43
What the heck?!?!?
Thu May 19, 2005 2:24 pm
Thu May 19, 2005 4:25 pm
Thu May 19, 2005 6:43 pm
Thu May 19, 2005 6:48 pm
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.
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?
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.
Thu May 19, 2005 8:49 pm