| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168694Image: ubuntu2004
Mack Talcott
MATH480 Spring 2010
Homework 3
Problem 1
[3, 2, 1, [3], 5]
Problem 2
[removed]
|
Problem 4
My solution doesn't work in Sage. Change the type of the worksheet above to python before evaluating this problem, or run the file included in the email.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_8.py", line 9, in <module>
exec compile(ur'open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" + _support_.preparse_worksheet_cell(base64.b64decode("c3F1YXJlX2N1YmVfcHJvdmVyKDIwMDAp"),globals())+"\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
File "", line 1, in <module>
File "/tmp/tmpc3EGFg/___code___.py", line 3, in <module>
exec compile(ur'square_cube_prover(_sage_const_2000 )' + '\n', '', 'single')
File "", line 1, in <module>
File "/tmp/tmpG7iPOB/___code___.py", line 13, in square_cube_prover
if i % (n/_sage_const_10 ) == _sage_const_0 :
File "rational.pyx", line 2290, in sage.rings.rational.Rational.__mod__ (sage/rings/rational.c:16853)
TypeError: Argument 'self' has incorrect type (expected sage.rings.rational.Rational, got int)
Problem 5
To test that the contents of the log file are right, I'd just run the file included in the email.