Omega_DeathSith apprentice to a box of CerealJoin Date: 2003-08-06Member: 19042Members
I tried to use C++
int main() { unsigned long double x; unsigned long double y = 1; double z;
for (x=1; x < 5000000001; x ++) { y = x * y; cout << y << endl; // so it can scroll the number slow enough to be seen for (z = 0 ; z < 500; z++) { cout << y << endl; } } return 1; }
Omega_DeathSith apprentice to a box of CerealJoin Date: 2003-08-06Member: 19042Members
<!--QuoteBegin-Cold NiTe+Mar 3 2005, 11:18 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Cold NiTe @ Mar 3 2005, 11:18 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Pjofsky, get mah gun. Thar be mathamaticiaans in them bushes. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd--> I wouldn't call myself a mathematician, just a bored Computer Engineering major who happens to have Visual Studio and a very large imagination.
Well.. for such a thing you'd really have to write your own C++ uber-long-int class. Pretty much jsut an array which you will translate large numbers into. Then you need ot write class member functions to multiply those arrays together in the appropriate fashion.
<!--QuoteBegin-Omega Death+Mar 3 2005, 11:00 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Omega Death @ Mar 3 2005, 11:00 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Can anyone tell me what 5,000,000,000! is? <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> 5 000 000 000! is the factorial of 5 000 000 000 (five billion)
it can be calculated by multiplying 5 000 000 000 by 4 999 999 999! (which can be calculated by multiplying 4 999 999 999 by 4 999 999 998! recursives are always fun)
the following c++ (borland style) code would calculate it if it didn't overflow: <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->long bignum; long startnum; long mynum; cin >> startnum; // 5 000 000 000 bignum = 1; for (mynum = startnum;mynum > 1; mynum--){ bignum = bignum * mynum;} cout << startnum + "! is equal to " + bignum; return 0 <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
i want my cookie
edit: <!--QuoteBegin-Umbraed Monkey+Mar 3 2005, 11:32 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Umbraed Monkey @ Mar 3 2005, 11:32 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->you want an exact answer on a post in this thread? from a quick estimate, the answer is at least 10GB.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> my physics teacher would kill you if he saw you sneaking a random unit onto a pure number
ThansalThe New ScumJoin Date: 2002-08-22Member: 1215Members, Constellation
hmm, can this be solved ussing scheme?
I know you can do some amazing things with it <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> (I honestly know nothing about the language, aside from the fact that one of the most anoying Java labs I did could be recreate in Scheme in 5 lines of code. And it ran in a fraction of a second for sometihng that java would fail at <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->)
<!--QuoteBegin-Mantrid+Mar 3 2005, 11:56 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mantrid @ Mar 3 2005, 11:56 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Well, based on that, couldn't you use a arithmetic sequence equation, going all the way down to 1! ?
I.e.,
Sn = n((A1 + An) / 2)
So, Sn = 4,999,999,999((2 + 4,999,999,999) / 2) = 12499999999999999999.5
Then, taking 12499999999999999999.5 and multiplying it by 1!, which is, of course, 1.
So, maybe the answer is 12499999999999999999.5 Then again, I never learned about Factorials, so I could be way off.
Edit: Nevermind, I meant to use a geometric sequence, but that won't allow you to do things with ratios equal to 1. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> God beaten by a 14 year old, <s><i>again</i></s>.
Omega_DeathSith apprentice to a box of CerealJoin Date: 2003-08-06Member: 19042Members
Factorials are just multiplication, 5! = 1*2*3*4*5 I ran Black Mage's code and it cheezed out and gives me 0 for everything over 32! because it can't figure that high of a number.
<!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused-fix.gif' border='0' style='vertical-align:middle' alt='confused-fix.gif' /><!--endemo--> Lets all just agree that 5 billion factorial is a really really uber super caek^googolplex number thingy with erm, arms labs on top <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused-fix.gif' border='0' style='vertical-align:middle' alt='confused-fix.gif' /><!--endemo-->
<!--QuoteBegin-Mantrid+Mar 4 2005, 12:56 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mantrid @ Mar 4 2005, 12:56 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->So, maybe the answer is 12499999999999999999.5<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> Maybe around that many digits... <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused-fix.gif' border='0' style='vertical-align:middle' alt='confused-fix.gif' /><!--endemo-->
<!--QuoteBegin-Renegade+Mar 4 2005, 01:22 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Renegade @ Mar 4 2005, 01:22 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->It's a really big number. Duuuh!<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> Yup, I think we reached a concensus that 5000000000! is "a really big number". <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->
Omega_DeathSith apprentice to a box of CerealJoin Date: 2003-08-06Member: 19042Members
<!--QuoteBegin-GNS+Mar 4 2005, 12:28 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (GNS @ Mar 4 2005, 12:28 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Its bigger than big its "double resnode" big. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd--> *Ding Ding Ding* we have a winnar.
<!--QuoteBegin-Omega Death+Mar 4 2005, 12:30 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Omega Death @ Mar 4 2005, 12:30 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin-GNS+Mar 4 2005, 12:28 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (GNS @ Mar 4 2005, 12:28 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Its bigger than big its "double resnode" big. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> *Ding Ding Ding* we have a winnar. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd--> Yay, what do I get? A potato?
<!--QuoteBegin-Mantrid+Mar 4 2005, 12:30 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mantrid @ Mar 4 2005, 12:30 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Actually, it won't be anywhere near that many digits. For example: <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd--> everytime you add one, you add the number of digits -1 in the number that you added to the answer: ie 1000! would be 3 digits longer than 999!, 1001! would be three digits longer than 1000! and 5 000 000 000 would be REALLY BLOODY LONG
<!--QuoteBegin-Black Mage+Mar 4 2005, 01:45 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Black Mage @ Mar 4 2005, 01:45 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><!--QuoteBegin-Mantrid+Mar 4 2005, 12:30 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Mantrid @ Mar 4 2005, 12:30 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Actually, it won't be anywhere near that many digits. For example: <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> everytime you add one, you add the number of digits -1 in the number that you added to the answer: ie 1000! would be 3 digits longer than 999!, 1001! would be three digits longer than 1000! and 5 000 000 000 would be REALLY BLOODY LONG<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--> Indeed. Using this method of estimation, 5000000000! has at least 43,884,838,845 digits.
This method merely assumes that all <i>n</i>-digit numbers add <i>n-1</i> digits to the product. This is not the rule. While 10 will always add only one digit, even 11 could potentially add two digits.
Comments
int main()
{
unsigned long double x;
unsigned long double y = 1;
double z;
for (x=1; x < 5000000001; x ++)
{
y = x * y;
cout << y << endl;
// so it can scroll the number slow enough to be seen
for (z = 0 ; z < 500; z++)
{
cout << y << endl;
}
}
return 1;
}
It just strings out INF after a few seconds.
I wouldn't call myself a mathematician, just a bored Computer Engineering major who happens to have Visual Studio and a very large imagination.
Possible, but a little time consuming.
Ugh, imagine trying to do that in Java....
*shudders*
5 000 000 000! is the factorial of 5 000 000 000 (five billion)
it can be calculated by multiplying 5 000 000 000 by 4 999 999 999! (which can be calculated by multiplying 4 999 999 999 by 4 999 999 998! recursives are always fun)
the following c++ (borland style) code would calculate it if it didn't overflow:
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->long bignum;
long startnum;
long mynum;
cin >> startnum; // 5 000 000 000
bignum = 1;
for (mynum = startnum;mynum > 1; mynum--){
bignum = bignum * mynum;}
cout << startnum + "! is equal to " + bignum;
return 0
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
i want my cookie
edit:
<!--QuoteBegin-Umbraed Monkey+Mar 3 2005, 11:32 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Umbraed Monkey @ Mar 3 2005, 11:32 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->you want an exact answer on a post in this thread? from a quick estimate, the answer is at least 10GB.<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
my physics teacher would kill you if he saw you sneaking a random unit onto a pure number
BANG! got 'im.
I know you can do some amazing things with it <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> (I honestly know nothing about the language, aside from the fact that one of the most anoying Java labs I did could be recreate in Scheme in 5 lines of code. And it ran in a fraction of a second for sometihng that java would fail at <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->)
i win!!
I.e.,
Sn = n((A1 + An) / 2)
So, Sn = 4,999,999,999((2 + 4,999,999,999) / 2) = 12499999999999999999.5
Then, taking 12499999999999999999.5 and multiplying it by 1!, which is, of course, 1.
So, maybe the answer is 12499999999999999999.5
Then again, I never learned about Factorials, so I could be way off.
Edit: Nevermind, I meant to use a geometric sequence, but that won't allow you to do things with ratios equal to 1.
I.e.,
Sn = n((A1 + An) / 2)
So, Sn = 4,999,999,999((2 + 4,999,999,999) / 2) = 12499999999999999999.5
Then, taking 12499999999999999999.5 and multiplying it by 1!, which is, of course, 1.
So, maybe the answer is 12499999999999999999.5
Then again, I never learned about Factorials, so I could be way off.
Edit: Nevermind, I meant to use a geometric sequence, but that won't allow you to do things with ratios equal to 1. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
God beaten by a 14 year old, <s><i>again</i></s>.
Must... kill... Mantrid...
I ran Black Mage's code and it cheezed out and gives me 0 for everything over 32! because it can't figure that high of a number.
My Ti-89 Titanium figured 449! to 3.85193e^997
No cookies yet.
Maybe around that many digits... <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused-fix.gif' border='0' style='vertical-align:middle' alt='confused-fix.gif' /><!--endemo-->
<!--QuoteBegin-Renegade+Mar 4 2005, 01:22 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Renegade @ Mar 4 2005, 01:22 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->It's a really big number. Duuuh!<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Yup, I think we reached a concensus that 5000000000! is "a really big number". <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->
*Ding Ding Ding* we have a winnar.
999! = 402,387,260,077,093,773,543,702,433,923,003,985,719,374,864,210,
714,632,543,799,910,429,938,512,398,629,020,592,044,208,486,
969,404,800,479,988,610,197,196,058,631,666,872,994,808,558,
901,323,829,669,944,590,997,424,504,087,073,759,918,823,627,
727,188,732,519,779,505,950,995,276,120,874,975,462,497,043,
601,418,278,094,646,496,291,056,393,887,437,886,487,337,119,
181,045,825,783,647,849,977,012,476,632,889,835,955,735,432,
513,185,323,958,463,075,557,409,114,262,417,474,349,347,553,
428,646,576,611,667,797,396,668,820,291,207,379,143,853,719,
588,249,808,126,867,838,374,559,731,746,136,085,379,534,524,
221,586,593,201,928,090,878,297,308,431,392,844,403,281,231,
558,611,036,976,801,357,304,216,168,747,609,675,871,348,312,
025,478,589,320,767,169,132,448,426,236,131,412,508,780,208,
000,261,683,151,027,341,827,977,704,784,635,868,170,164,365,
024,153,691,398,281,264,810,213,092,761,244,896,359,928,705,
114,964,975,419,909,342,221,566,832,572,080,821,333,186,116,
811,553,615,836,546,984,046,708,975,602,900,950,537,616,475,
847,728,421,889,679,646,244,945,160,765,353,408,198,901,385,
442,487,984,959,953,319,101,723,355,556,602,139,450,399,736,
280,750,137,837,615,307,127,761,926,849,034,352,625,200,015,
888,535,147,331,611,702,103,968,175,921,510,907,788,019,393,
178,114,194,545,257,223,865,541,461,062,892,187,960,223,838,
971,476,088,506,276,862,967,146,674,697,562,911,234,082,439,
208,160,153,780,889,893,964,518,263,243,671,616,762,179,168,
909,779,911,903,754,031,274,622,289,988,005,195,444,414,282,
012,187,361,745,992,642,956,581,746,628,302,955,570,299,024,
324,153,181,617,210,465,832,036,786,906,117,260,158,783,520,
751,516,284,225,540,265,170,483,304,226,143,974,286,933,061,
690,897,968,482,590,125,458,327,168,226,458,066,526,769,958,
652,682,272,807,075,781,391,858,178,889,652,208,164,348,344,
825,993,266,043,367,660,176,999,612,831,860,788,386,150,279,
465,955,131,156,552,036,093,988,180,612,138,558,600,301,435,
694,527,224,206,344,631,797,460,594,682,573,103,790,084,024,
432,438,465,657,245,014,402,821,885,252,470,935,190,620,929,
023,136,493,273,497,565,513,958,720,559,654,228,749,774,011,
413,346,962,715,422,845,862,377,387,538,230,483,865,688,976,
461,927,383,814,900,140,767,310,446,640,259,899,490,222,221,
765,904,339,901,886,018,566,526,485,061,799,702,356,193,897,
017,860,040,811,889,729,918,311,021,171,229,845,901,641,921,
068,884,387,121,855,646,124,960,798,722,908,519,296,819,372,
388,642,614,839,657,382,291,123,125,024,186,649,353,143,970,
137,428,531,926,649,875,337,218,940,694,281,434,118,520,158,
014,123,344,828,015,051,399,694,290,153,483,077,644,569,099,
073,152,433,278,288,269,864,602,789,864,321,139,083,506,217,
095,002,597,389,863,554,277,196,742,822,248,757,586,765,752,
344,220,207,573,630,569,498,825,087,968,928,162,753,848,863,
396,909,959,826,280,956,121,450,994,871,701,244,516,461,260,
379,029,309,120,889,086,942,028,510,640,182,154,399,457,156,
805,941,872,748,998,094,254,742,173,582,401,063,677,404,595,
741,785,160,829,230,135,358,081,840,096,996,372,524,230,560,
855,903,700,624,271,243,416,909,004,153,690,105,933,983,835,
777,939,410,970,027,753,472,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000
*Ding Ding Ding* we have a winnar. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
Yay, what do I get? A potato?
I didn't.
<a href='http://www.newdream.net/~sage/old/numbers/fact.htm' target='_blank'>The first 999 factorials.</a>
everytime you add one, you add the number of digits -1 in the number that you added to the answer: ie 1000! would be 3 digits longer than 999!, 1001! would be three digits longer than 1000! and 5 000 000 000 would be REALLY BLOODY LONG
everytime you add one, you add the number of digits -1 in the number that you added to the answer: ie 1000! would be 3 digits longer than 999!, 1001! would be three digits longer than 1000! and 5 000 000 000 would be REALLY BLOODY LONG<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Indeed. Using this method of estimation, 5000000000! has at least 43,884,838,845 digits.
This method merely assumes that all <i>n</i>-digit numbers add <i>n-1</i> digits to the product. This is not the rule. While 10 will always add only one digit, even 11 could potentially add two digits.
you could always do it the old fashioned way and do it by hand...
....