Size: 48186
Comment:
|
Size: 48486
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 79: | Line 79: |
html(s) | pretty_print(html(s)) |
Line 89: | Line 89: |
html("<font color='red'>$\pi(x)$</font> and <font color='blue'>$x/(\log(x)-1)$</font> for $x < %s$"%N) | pretty_print(html("<font color='red'>$\pi(x)$</font> and <font color='blue'>$x/(\log(x)-1)$</font> for $x < %s$"%N)) |
Line 115: | Line 115: |
else: print 'NaN' | else: print('NaN') |
Line 140: | Line 140: |
if start < 1 or end <=start: print "invalid start or end value" if n > end: print "WARNING: n is larger than the end value" |
if start < 1 or end <=start: print("invalid start or end value") if n > end: print("WARNING: n is larger than the end value") |
Line 172: | Line 172: |
#print x_cord, y_cord | |
Line 183: | Line 182: |
#print x, "=x y=", y, " num =", num | |
Line 209: | Line 207: |
print '(to go from x,y coords to an n, reset by setting n=0)' | print('(to go from x,y coords to an n, reset by setting n=0)') |
Line 211: | Line 209: |
#print 'if n =', n, 'then (x,y) =', (x_cord, y_cord) print '(x,y) =', (x_cord, y_cord), '<=> n =', find_n(x_cord, y_cord, start) print ' ' print "SW/NE line" if -y_cord<x_cord: print '4*t^2 + 2*t +', -x_cord+y_cord+start else: print '4*t^2 + 2*t +', +x_cord-y_cord+start print "NW/SE line" if x_cord<y_cord: print '4*t^2 +', -x_cord-y_cord+start else: print '4*t^2 + 4*t +', +x_cord+y_cord+start |
print('(x,y) =', (x_cord, y_cord), '<=> n =', find_n(x_cord, y_cord, start)) print(' ') print("SW/NE line") if -y_cord<x_cord: print('4*t^2 + 2*t +', -x_cord+y_cord+start) else: print('4*t^2 + 2*t +', +x_cord-y_cord+start) print("NW/SE line") if x_cord<y_cord: print('4*t^2 +', -x_cord-y_cord+start) else: print('4*t^2 + 4*t +', +x_cord+y_cord+start) |
Line 233: | Line 230: |
Needs fix for show_factors |
|
Line 239: | Line 238: |
if start < 1 or end <=start: print "invalid start or end value" if n > end: print "WARNING: n is greater than end value" |
if start < 1 or end <=start: print("invalid start or end value") if n > end: print("WARNING: n is greater than end value") |
Line 262: | Line 261: |
print 'n =', factor(n) | print('n = {}'.format(factor(n))) |
Line 284: | Line 283: |
print 'Pink Curve: n^2 +', c print 'Green Curve: n^2 + n +', c2 |
print('Pink Curve: n^2 +', c) print('Green Curve: n^2 + n +', c2) |
Line 312: | Line 311: |
print M; print '\n'*3 print "Computing basis...\n\n" |
print(M) print('\n' * 3) print("Computing basis...\n\n") |
Line 315: | Line 315: |
print "Space has dimension 0" | print("Space has dimension 0") |
Line 317: | Line 317: |
prec = max(prec, M.dimension()+1) | prec = max(prec, M.dimension() + 1) |
Line 320: | Line 320: |
print "\n\n\nDone computing basis." | print("\n\n\nDone computing basis.") |
Line 328: | Line 328: |
{{{#!sagecell html('<h1>Cuspidal Subgroups of Modular Jacobians J0(N)</h1>') |
ncols not working {{{#!sagecell pretty_print(html('<h1>Cuspidal Subgroups of Modular Jacobians J0(N)</h1>')) |
Line 333: | Line 335: |
print A.cuspidal_subgroup() | print(A.cuspidal_subgroup()) |
Line 475: | Line 477: |
MP += text('$\omega^2$',(i+.5,r-j-.5),rgbcolor='black') | MP += text(r'$\omega^2$',(i+.5,r-j-.5),rgbcolor='black') |
Line 477: | Line 479: |
MP += text('$\omega $',(i+.5,r-j-.5),rgbcolor='black') | MP += text(r'$\omega $',(i+.5,r-j-.5),rgbcolor='black') |
Line 486: | Line 488: |
MP += text('$ \pi_1$',(r/2,r+2), rgbcolor='black', fontsize=25) MP += text('$ \pi_2$',(-2.5,r/2), rgbcolor='black', fontsize=25) html('Symmetry of Primary Cubic Residues mod ' \ + '%d primary primes in $ \mathbf Z[\omega]$.'%r) |
MP += text(r'$ \pi_1$',(r/2,r+2), rgbcolor='black', fontsize=25) MP += text(r'$ \pi_2$',(-2.5,r/2), rgbcolor='black', fontsize=25) pretty_print(html('Symmetry of Primary Cubic Residues mod ' \ + r'%d primary primes in $ \mathbf Z[\omega]$.'%r)) |
Line 644: | Line 646: |
html('$$J(%s,%s) = %s$$'%(latex2(e),latex2(f),latex(js))) | pretty_print(html('$$J(%s,%s) = %s$$'%(latex2(e),latex2(f),latex(js)))) |
Line 664: | Line 666: |
html(s)}}} | pretty_print(html(s)) }}} |
Line 754: | Line 757: |
print "p = %s"%p show(E.change_ring(GF(p)).plot(),xmin=0,ymin=0) |
print("p = %s" % p) show(E.change_ring(GF(p)).plot(), xmin=0, ymin=0) |
Line 817: | Line 820: |
c = list(continued_fraction(RealField(prec)(number))); print c | c = list(continued_fraction(RealField(prec)(number))); print(c) |
Line 846: | Line 849: |
L = [[-0.5, 2.0^(x/100.0) - 1 + sqrt(3.0)/2] for x in xrange(1000, -1, -1)] R = [[0.5, 2.0^(x/100.0) - 1 + sqrt(3.0)/2] for x in xrange(1000)] xes = [x/1000.0 for x in xrange(-500,501,1)] |
L = [[-0.5, 2.0^(x/100.0) - 1 + sqrt(3.0)/2] for x in range(1000, -1, -1)] R = [[0.5, 2.0^(x/100.0) - 1 + sqrt(3.0)/2] for x in range(1000)] xes = [x/1000.0 for x in range(-500,501,1)] |
Line 872: | Line 875: |
= Multiple Zeta Values = | = Multiple Zeta Values = |
Line 874: | Line 877: |
== Computing Multiple Zeta values == | == Computing Multiple Zeta values == |
Line 879: | Line 882: |
def _( weight=(5,(2..20))): | def _( weight=(5,(2..100))): |
Line 932: | Line 935: |
print zeta(a) | u=zeta(a) RIF=RealIntervalField(int(3.321928*D)) u=u/1 print(u) |
Line 939: | Line 945: |
def _( Depth=(5,(2..20))): | def _( Depth=(5,(2..100))): |
Line 998: | Line 1004: |
print zeta(a) |
u=zeta(a) RIF=RealIntervalField(int(3.321928*D)) u=u/1 print(u) |
Line 1005: | Line 1013: |
print "Enter the number of composition" @interact def _( n=(5,(2..20))): |
print("Enter the number of composition") @interact def _( n=(5,(2..100))): |
Line 1011: | Line 1019: |
print "In each box Enter composition as an array" | print("In each box Enter composition as an array") |
Line 1022: | Line 1030: |
DD=int(3.321928*D)+int(R(log(3.321928*D))/R(log(10)))+4 | DD=int(D)+int(R(log(3.321928*D))/R(log(10)))+4 |
Line 1071: | Line 1079: |
print "zeta(",a[i],")=",zet[i] | mp.dps=D for i in range(n): zet[i]=zet[i]/1 print("zeta(", a[i], ")=", zet[i]) |
Line 1073: | Line 1084: |
print "the Intger Relation between the above zeta values given by the vector" print u }}} |
print("the Intger Relation between the above zeta values given by the vector") print(u) }}} {{attachment:akhi10.png}} |
Line 1080: | Line 1091: |
def _( weight=(7,(2..30))): | def _( weight=(7,(2..100))): |
Line 1097: | Line 1108: |
print "Composition is ",bintocomp(a) | print("Composition is {}".format(bintocomp(a))) |
Line 1104: | Line 1115: |
def _( Depth=(7,(1..30))): | def _( Depth=(7,(1..100))): |
Line 1118: | Line 1129: |
print "Word is ",comptobin(a) | print("Word is {}".format(comptobin(a))) |
Line 1125: | Line 1136: |
def _( weight=(7,(2..30))): | def _( weight=(7,(2..100))): |
Line 1140: | Line 1151: |
print "Dual word is ",dual(a) | print("Dual word is {}"?format(dual(a))) |
Line 1149: | Line 1160: |
def _( w1=(2,(2..20)), w2=(2,(2..20))): | def _( w1=(2,(2..100)), w2=(2,(2..100))): |
Line 1227: | Line 1238: |
print c[1][i],"*",c[0][i] ,"+ ", print c[1][len(c[0])-1],"*",c[0][len(c[0])-1] |
print(c[1][i],"*",c[0][i] ,"+ ") print(c[1][len(c[0])-1],"*",c[0][len(c[0])-1]) |
Line 1236: | Line 1247: |
def _( w=(2,(2..20))): | def _( w=(2,(2..100))): |
Line 1376: | Line 1387: |
c=Regshuf0(a) | c = Regshuf0(a) |
Line 1379: | Line 1390: |
print c[1][i],"*",c[0][i] ,"+ ", | print(c[1][i],"*",c[0][i] ,"+ ") |
Line 1381: | Line 1392: |
print c[1][len(c[0])-1],"*",c[0][len(c[0])-1] | print(c[1][len(c[0])-1],"*",c[0][len(c[0])-1]) |
Line 1529: | Line 1540: |
c=Regshuf1(a) | c = Regshuf1(a) |
Line 1532: | Line 1543: |
print c[1][i],"*",c[0][i] ,"+ ", | print(c[1][i],"*",c[0][i] ,"+ ") |
Line 1534: | Line 1545: |
print c[1][len(c[0])-1],"*",c[0][len(c[0])-1] | print(c[1][len(c[0])-1],"*",c[0][len(c[0])-1]) |
Contents
Integer Factorization
Divisibility Poset
by William Stein
Factor Trees
by William Stein
More complicated demonstration using Mathematica: http://demonstrations.wolfram.com/FactorTrees/
Factoring an Integer
by Timothy Clemans
Sage implementation of the Mathematica demonstration of the same name. http://demonstrations.wolfram.com/FactoringAnInteger/
Prime Numbers
Illustrating the prime number theorem
by William Stein
Prime Spiral - Square FIXME
by David Runde
Prime Spiral - Polar
by David Runde
Needs fix for show_factors
Modular Forms
Computing modular forms
by William Stein
Computing the cuspidal subgroup
by William Stein
ncols not working
A Charpoly and Hecke Operator Graph
by William Stein
Modular Arithmetic
Quadratic Residue Table FIXME
by Emily Kirkman
Cubic Residue Table FIXME
by Emily Kirkman
Cyclotomic Fields
Gauss and Jacobi Sums in Complex Plane
by Emily Kirkman
Exhaustive Jacobi Plotter
by Emily Kirkman
Elliptic Curves
Adding points on an elliptic curve
by David Møller Hansen
Plotting an elliptic curve over a finite field
Cryptography
The Diffie-Hellman Key Exchange Protocol
by Timothy Clemans and William Stein
Other
Continued Fraction Plotter
by William Stein
Computing Generalized Bernoulli Numbers
by William Stein (Sage-2.10.3)
Fundamental Domains of SL_2(ZZ)
by Robert Miller
Multiple Zeta Values
by Akhilesh P.
Computing Multiple Zeta values
Word Input
Composition Input
Program to Compute Integer Relation between Multiple Zeta Values
Word to composition
Composition to Word
Dual of a Word
Shuffle product of two Words
Shuffle Regularization at 0
Shuffle Regularization at 1