Differences between revisions 43 and 67 (spanning 24 versions)
 ⇤ ← Revision 43 as of 2014-12-20 19:35:36 → Size: 34981 Editor: akhi Comment: ← Revision 67 as of 2020-06-04 19:14:06 → ⇥ Size: 48538 Editor: kcrisman 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("$\pi(x)$ and $x/(\log(x)-1)$ for $x < %s$"%N) pretty_print(html("$\pi(x)$ and $x/(\log(x)-1)$ 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 n =', find_n(x_cord, y_cord, start))    print(' ')    print("SW/NE line")    if -y_cord 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: {{{#!sagecellhtml('

Cuspidal Subgroups of Modular Jacobians J0(N)

') ncols not working{{{#!sagecellpretty_print(html('

Cuspidal Subgroups of Modular Jacobians J0(N)

')) 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 778: Line 781: html(""" pretty_print(html(""" Line 804: Line 807: (g^ b)^a, g^a, b, p, (g^a)^b)) (g^ b)^a, g^a, b, p, (g^a)^b))) Line 814: Line 817: crows not working Line 817: Line 822: c = list(continued_fraction(RealField(prec)(number))); print c c = list(continued_fraction(RealField(prec)(number))); print(c) Line 826: Line 831: def _(m=selector([1..15],nrows=2), n=(7,(3..10))): def _(m=selector([1..15],nrows=2), n=(7,[3..10])): Line 828: Line 833: s = "

First n=%s Bernoulli numbers attached to characters with modulus m=%s

"%(n,m)    s += ''    s += '
$\\chi$Conductor$B_{%s,\chi}$
$\chi$Conductor$B_{%s,\chi}$
' + \           ''.join(''%k for k in [1..n]) + '' s = r"

First n=%s Bernoulli numbers attached to characters with modulus m=%s

"%(n,m)    s += r''    s += r'' + \           ''.join(r''%k for k in [1..n]) + '' Line 837: Line 842: html(s) pretty_print(html(s)) Line 846: Line 851: 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 877: = Multiple Zeta Values = = Multiple Zeta Values  = Line 874: Line 879: == Word to composition =={{{#!sagecell@interactdef _( weight=(7,(2..30))): n=weight a=[0 for i in range(n-1)] a.append(1) @interact def _(v=('word', input_grid(1, n, default=[a], to_value=lambda x: vector(flatten(x))))):  a=[v[i] for i in range(len(v))]  def bintocomp(a): b=[] count=1 for j in range(len(a)):  if(a[j]==0):   count=count+1  else:   b.append(count)   count=1  return(b)  print "Composition is ",bintocomp(a)}}}{{attachment:akhi2.png}}== Composition to Word =={{{#!sagecell@interactdef _( Depth=(7,(1..30))): n=Depth a=[] a.append(2) a=a+[1 for i in range(1,n)] @interact def _(v=('composition', input_grid(1, n, default=[a], to_value=lambda x: vector(flatten(x))))):  a=[v[i] for i in range(len(v))]  def comptobin(a): word=[] for i in range(len(a)):  word=word+[0]*(a[i]-1)+[1] return(word)  print "Word is ",comptobin(a)}}}{{attachment:akhi3.png}}== Computing Multiple Zeta values == == Computing Multiple Zeta values == Line 926: Line 884: def _( weight=(5,(2..20))): def _( weight=(5,(2..100))): Line 979: Line 937: print zeta(a) u=zeta(a)  RIF=RealIntervalField(int(3.321928*D))  u=u/1  print(u) Line 986: Line 947: def _( Depth=(5,(2..20))): n=weight def _( Depth=(5,(2..100))): n=Depth Line 994: Line 955: def comptobin(a):        word=[]        for i in range(len(a)):                word=word+[0]*(a[i]-1)+[1]        return(word) Line 1040: Line 1006: u=zeta(a)  RIF=RealIntervalField(int(3.321928*D))  u=u/1  print(u)}}}{{attachment:akhi5.png}}== Program to Compute Integer Relation between Multiple Zeta Values =={{{#!sagecellfrom mpmath import *print("Enter the number of composition")@interactdef _( n=(5,(2..100))): a=[] for i in range(n):        a.append([i+2,1]) print("In each box Enter composition as an array") @interact def _(v=('Compositions', input_box( default=a, to_value=lambda x: vector(flatten(x)))), accuracy=(100..100000)):  D=accuracy  R=RealField(10)  a=v  def comptobin(a):        word=[]        for i in range(len(a)):                word=word+[0]*(a[i]-1)+[1]        return(word)  DD=int(D)+int(R(log(3.321928*D))/R(log(10)))+4  RIF=RealIntervalField(DD)  mp.dps=DD  def Li(word):        n=int(DD*log(10)/log(2))+1        B=[]        L=[]        S=[]        count=-1        k=len(word)        for i in range(k):                B.append(mpf('0'))                L.append(mpf('0'))                if(word[i]==1 and i

# Integer Factorization

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

by William Stein

by David Runde

## Prime Spiral - Polar

by David Runde

Needs fix for show_factors

# Modular Forms

by William Stein

## Computing the cuspidal subgroup

by William Stein

ncols not working

by William Stein

by Emily Kirkman

by Emily Kirkman

by Emily Kirkman

by Emily Kirkman

# Elliptic Curves

## Adding points on an elliptic curve

by David Møller Hansen

# Cryptography

## The Diffie-Hellman Key Exchange Protocol

by Timothy Clemans and William Stein

# Other

## Continued Fraction Plotter

by William Stein

crows not working

## Computing Generalized Bernoulli Numbers

by William Stein (Sage-2.10.3)

by Robert Miller

# Multiple Zeta Values

by Akhilesh P.

## Shuffle Regularization at 1

interact/number_theory (last edited 2020-06-14 09:10:48 by chapoton)