Differences between revisions 13 and 14
Revision 13 as of 2006-10-09 22:59:54
Size: 1131
Editor: anonymous
Comment:
Revision 14 as of 2006-10-09 23:03:16
Size: 900
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:


################################################################################
# Wiki form worksheet: _scratch_
################################################################################
Line 30: Line 35:
sage: for i in range(20): sage: for i in range(200):
Line 33: Line 38:
... print str(c + 1)+': '
... print a
1:
3
1:
7
1:
31
1:
127
1:
8191
1:
131071
1:
524287}}}
... c += 1
... print str(c)+': '+str(a)
1: 3
2: 7
3: 31
4: 127
5: 8191
6: 131071
7: 524287
8: 2147483647
9: 2305843009213693951
10: 618970019642690137449562111
11: 162259276829213363391578010288127
12: 170141183460469231731687303715884105727}}}
Line 57: Line 60:


{{{#!python
sage: a = 5
}}}

{{{#!python
sage: a
5}}}

{{{#!python
sage: sage.server.notebook.worksheet.Cell.worksheet.im_class.files_html()
Traceback (most recent call last):
...
TypeError: unbound method files_html() must be called with Cell instance as first argument (got nothing instead)}}}

{{{#!python
sage: _scratch___plain__
Traceback (most recent call last):
...
NameError: name '_scratch___plain__' is not defined}}}

{{{#!python
sage: for i in range(10):
... print i*i - 2
-2
-1
2
7
14
23
34
47
62
79}}}

{{{#!python

}}}

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

# Wiki form worksheet: _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 

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