Copy cells from wiki-form window in sage worksheet and paste directly into wiki edit.

# Wiki form worksheet (with prompt): _scratch_

   1 sage: a = 5

   1 sage: a
   2 5

   1 sage: for i in range(10):
   2 ...    print i*i - 2
   3 -2
   4 -1
   5 2
   6 7
   7 14
   8 23
   9 34
  10 47
  11 62
  12 79

   1 sage: c=0
   2 sage: for i in range(200):
   3 ...    a = 2^i -1
   4 ...    if a.is_prime():
   5 ...        c += 1
   6 ...        print str(c)+': '+str(a)
   7 1: 3
   8 2: 7
   9 3: 31
  10 4: 127
  11 5: 8191
  12 6: 131071
  13 7: 524287
  14 8: 2147483647
  15 9: 2305843009213693951
  16 10: 618970019642690137449562111
  17 11: 162259276829213363391578010288127
  18 12: 170141183460469231731687303715884105727

   1 sage: a.is_prime()
   2 True

   1 

# Wiki form worksheet: _scratch_

   1 

   1 b=10

   1 a.is_prime()
   2 out: True

   1 a
   2 out: 5

   1 

   1 a = 5

   1 

   1 a
   2 out: 5

   1 for i in range(10):
   2     print i*i - 2
   3 out: -2
   4  -1
   5  2
   6  7
   7  14
   8  23
   9  34
  10  47
  11  62
  12  79

   1 c=0
   2 for i in range(200):
   3     a = 2^i -1
   4     if a.is_prime():
   5         c += 1
   6         print str(c)+': '+str(a)
   7 out: 1: 3
   8  2: 7
   9  3: 31
  10  4: 127
  11  5: 8191
  12  6: 131071
  13  7: 524287
  14  8: 2147483647
  15  9: 2305843009213693951
  16  10: 618970019642690137449562111
  17  11: 162259276829213363391578010288127
  18  12: 170141183460469231731687303715884105727

   1 t = Tachyon(xres=512,yres=512, camera_center=(5,0,0))
   2 t.light((4,3,2), 0.2, (1,1,1))
   3 t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0))
   4 t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0))
   5 t.texture('t2', ambient=0.2, diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0))
   6 k=0
   7 for i in srange(-5,1.5,0.1):
   8     k += 1
   9     t.sphere((i,i^2-0.5,i^3), 0.1, 't%s'%(k%3))
  10 
  11 t.show()

   1 

dmr/notebookwiki (last edited 2008-11-14 13:42:08 by anonymous)