Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168742
Image: ubuntu2004
divisors(220)
[1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110, 220]
divisors(284)
[1, 2, 4, 71, 142, 284]
1+2+4+71+142
220
1+2+4+5+10+11+20+22+44+55+110
284
divisors(28)
[1, 2, 4, 7, 14, 28]
1+2+4+7+14
28
sum(divisors(28))
56
var("n") s(n)=sum(divisors(n))-n
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_10.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("dmFyKCJuIikKcyhuKT1zdW0oZGl2aXNvcnMobikpLW4="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpVBYRUE/___code___.py", line 3, in <module> exec compile(u'__tmp__=var("n"); s = symbolic_expression(sum(divisors(n))-n).function(n)' + '\n', '', 'single') File "", line 1, in <module> File "/sagenb/sage_install/sage-4.8-sage.math.washington.edu-x86_64-Linux/local/lib/python2.6/site-packages/sage/rings/arith.py", line 1301, in divisors for p, e in f: TypeError: 'sage.symbolic.expression.Expression' object is not iterable
def s(n): list=divisors(n) total=sum(list) return total-n
s(28)
28
s(220)
284
s(284)
220
s(1184)
1210
s(1210)
1184
point([ (1, 2, 3), (4, 5, 6), (0, 1, 0), (0, 0, 1) ])
@interact def f(n=[0..4], s=(1..5), y=(0,1,0.01)): show(plot(sin(n+x^s)+y, -pi, pi))
[removed]
[removed]
[removed]
[removed]
@interact def myhelper(x0=(1,10,0.01)): g(x)=sqrt(x) gprime(x)=diff(g(x)) slope=gprime(x0) show(plot( g(x), 0, 10) + plot( slope*(x - x0) + g(x0), 0, 10, color='brown' ) + point( (x0, g(x0)) ) )
x0 
[removed]
[removed]
[removed]
[removed]
@interact def myhelper2(x0=(1,10,0.01), choice=[ "ln", "log", "ld" ]): if (choice=="ln"): g(x)=ln(x) elif (choice=="log"): g(x)=log(x, 10) elif (choice=="ld"): g(x)=log(x, 2) else: print("?!?!") g(x)=x gprime(x)=diff(g(x)) slope=gprime(x0) show(plot( g(x), 0.5, 10) + plot( slope*(x - x0) + g(x0), 0.5, 10, color='brown' ) + point( (x0, g(x0)) ) )
x0 
choice 
[removed]
[removed]
[removed]
[removed]