Tommy Maltells test nr 1 av Sage

845 days ago by tmaltell

4567877*4455566 
       
20352477453382
20352477453382
 
       
4*3^2-8 
       
28
28
 
       
2^32 
       
4294967296
4294967296
2^128 
       
340282366920938463463374607431768211456
340282366920938463463374607431768211456
2^256 
       
115792089237316195423570985008687907853269984665640564039457584007913129\
639936
115792089237316195423570985008687907853269984665640564039457584007913129639936
factor(3298732907320932093209) 
       
3271 * 14251 * 5798183 * 12204763
3271 * 14251 * 5798183 * 12204763
factor(55685760976097690679009230923092309239032023093293200392) 
       
2^3 * 3^3 * 7 * 13367 *
2755233559869350261572131109182068710980568859923
2^3 * 3^3 * 7 * 13367 * 2755233559869350261572131109182068710980568859923
factorial(5) 
       
120
120
factorial(-5) 
       
Traceback (click to the left of this block for traceback)
...
ValueError: factorial -- must be nonnegative
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sage/sagenb/sage_notebook/worksheets/tmaltell/0/code/5.py", line 7, in <module>
    factorial(-_sage_const_5 )
  File "/home/sage/sage_install/sage/local/lib/python2.5/site-packages/Jinja-1.2-py2.5-linux-x86_64.egg/", line 1, in <module>
    
  File "/home/sage/sage_install/sage/local/lib/python2.5/site-packages/sage/functions/other.py", line 568, in __call__
    return factorial(n, **kwds)
  File "/home/sage/sage_install/sage/local/lib/python2.5/site-packages/sage/rings/arith.py", line 328, in factorial
    raise ValueError, "factorial -- must be nonnegative"
ValueError: factorial -- must be nonnegative
x, b, c = var('x b c') solve([x^2 + b*x + c == 0],x) 
       
[x == -1/2*b - 1/2*sqrt(b^2 - 4*c), x == -1/2*b + 1/2*sqrt(b^2 - 4*c)]
[x == -1/2*b - 1/2*sqrt(b^2 - 4*c), x == -1/2*b + 1/2*sqrt(b^2 - 4*c)]
x = var('x') solve(x**2 + 3*x + 2, x) 
       
[x == -2, x == -1]
[x == -2, x == -1]
x = var('x'); solve(x^2 + 3*x, x) 
       
[x == -3, x == 0]
[x == -3, x == 0]
485868686787786868686858585858558558*5858585847848484848484848484 
       
2846503412327656260433944831747679971537153089659635139271526072
2846503412327656260433944831747679971537153089659635139271526072
factorial(300) 
       
306057512216440636035370461297268629388588804173576999416776741259476533\
176716867465515291422477573349939147888701726368864263907759003154226842\
927906974559841225476930271954604008012215776252176854255965356903506788\
725264321896264299365204576448830388909753943489625436053225980776521270\
822437639449120128678675368305712293681943649956460498166450227716500185\
176546469340112226034729724066333258583506870150169794168850353752137554\
910289126407157154830282284937952636580145235233156936482233436799254594\
095276820608062232812387383880817049600000000000000000000000000000000000\
000000000000000000000000000000000000000
306057512216440636035370461297268629388588804173576999416776741259476533176716867465515291422477573349939147888701726368864263907759003154226842927906974559841225476930271954604008012215776252176854255965356903506788725264321896264299365204576448830388909753943489625436053225980776521270822437639449120128678675368305712293681943649956460498166450227716500185176546469340112226034729724066333258583506870150169794168850353752137554910289126407157154830282284937952636580145235233156936482233436799254594095276820608062232812387383880817049600000000000000000000000000000000000000000000000000000000000000000000000000