Differences between revisions 28 and 29
 ⇤ ← Revision 28 as of 2012-05-09 13:09:01 → Size: 30464 Editor: chapoton Comment: fixed "A Charpoly and Hecke Operator Graph" ? ← Revision 29 as of 2012-05-09 13:34:14 → ⇥ Size: 30359 Editor: chapoton Comment: fixed Adding points on an elliptic curve Deletions are marked like this. Additions are marked like this. Line 51: Line 51: g += line([(j*2-len(cur),-i), ((k*2)-len(rows[i-1]),-i+1)], g += line([(j*2-len(cur),-i), ((k*2)-len(rows[i-1]),-i+1)], Line 101: Line 101: REFERENCES: REFERENCES: Line 106: Line 106: Weisstein, Eric W. "Prime-Generating Polynomial." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Prime-GeneratingPolynomial.html Weisstein, Eric W. "Prime-Generating Polynomial." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Prime-GeneratingPolynomial.html Line 114: Line 114: elif y<0 and -x >= y and y= y and y (floor(sqrt(n)))^2 and n <= (floor(sqrt(n)))^2 + floor(sqrt(n)): if n > (floor(sqrt(n)))^2 and n <= (floor(sqrt(n)))^2 + floor(sqrt(n)): Line 281: Line 281: else: else: Line 286: Line 286: def g(m): return (a*m^2+b*m+c); def g(m): return (a*m^2+b*m+c); Line 292: Line 292: c= c2; c= c2; Line 309: Line 309: def _(N=[1..100], k=selector([2,4,..,12],nrows=1), prec=(3..40), def _(N=[1..100], k=selector([2,4,..,12],nrows=1), prec=(3..40), Line 472: Line 472: MP += line([(i,0),(i,r)], rgbcolor='black') MP += line([(i,0),(i,r)], rgbcolor='black') Line 553: Line 553: S += point(e_pt,pointsize=50, rgbcolor='red') S += point(e_pt,pointsize=50, rgbcolor='red') Line 556: Line 556: S += point(f_gs_pt,pointsize=75, rgbcolor='black') S += point(f_gs_pt,pointsize=75, rgbcolor='black') Line 561: Line 561: S += text('$J(%s,%s) = %s$'%(latex2(e),latex2(f),latex(js)), S += text('$J(%s,%s) = %s$'%(latex2(e),latex2(f),latex(js)), Line 633: Line 633: S += point(e_pt,pointsize=50, rgbcolor='red') S += point(e_pt,pointsize=50, rgbcolor='red') Line 670: Line 670: == Adding points on an elliptic curve FIXME == == Adding points on an elliptic curve == Line 678: Line 678: else: else: Line 685: Line 685: def line_from_curve_points(E,P,Q,style='-',rgb=(1,0,0),length=25): """ P,Q two points on an elliptic curve. Output is a graphic representation of the straight line intersecting with P,Q. """ # The function tangent to P=Q on E if P == Q:  if P[2]==0:   return line([(1,-length),(1,length)],linestyle=style,rgbcolor=rgb)  else:   # Compute slope of the curve E in P   l=-(3*P[0]^2 + 2*E.a2()*P[0] + E.a4() - E.a1()*P[1])/((-2)*P[1] - E.a1()*P[0] - E.a3())   f(x) = l * (x - P[0]) + P[1]   return plot(f(x),-length,length,linestyle=style,rgbcolor=rgb) # Trivial case of P != R where P=O or R=O then we get the vertical line from the other point elif P[2] == 0:  return line([(Q[0],-length),(Q[0],length)],linestyle=style,rgbcolor=rgb) elif Q[2] == 0:  return line([(P[0],-length),(P[0],length)],linestyle=style,rgbcolor=rgb) # Non trivial case where P != R else:  # Case where x_1 = x_2 return vertical line evaluated in Q  if P[0] == Q[0]:   return line([(P[0],-length),(P[0],length)],linestyle=style,rgbcolor=rgb)  #Case where x_1 != x_2 return line trough P,R evaluated in Q"  l=(Q[1]-P[1])/(Q[0]-P[0])  f(x) = l * (x - P[0]) + P[1]  return plot(f(x),-length,length,linestyle=style,rgbcolor=rgb) Line 687: Line 718: curve = E.plot(rgbcolor = (0,0,1),xmin=25,xmax=25,plot_points=300) curve = E.plot(rgbcolor = (0,0,1),xmin=-5,xmax=5,plot_points=300) Line 713: Line 744: def line_from_curve_points(E,P,Q,style='-',rgb=(1,0,0),length=25): """ P,Q two points on an elliptic curve. Output is a graphic representation of the straight line intersecting with P,Q. """ # The function tangent to P=Q on E if P == Q:  if P[2]==0:   return line([(1,-length),(1,length)],linestyle=style,rgbcolor=rgb)  else:   # Compute slope of the curve E in P   l=-(3*P[0]^2 + 2*E.a2()*P[0] + E.a4() - E.a1()*P[1])/((-2)*P[1] - E.a1()*P[0] - E.a3())   f(x) = l * (x - P[0]) + P[1]   return plot(f(x),-length,length,linestyle=style,rgbcolor=rgb) # Trivial case of P != R where P=O or R=O then we get the vertical line from the other point elif P[2] == 0:  return line([(Q[0],-length),(Q[0],length)],linestyle=style,rgbcolor=rgb) elif Q[2] == 0:  return line([(P[0],-length),(P[0],length)],linestyle=style,rgbcolor=rgb) # Non trivial case where P != R else:   # Case where x_1 = x_2 return vertical line evaluated in Q  if P[0] == Q[0]:   return line([(P[0],-length),(P[0],length)],linestyle=style,rgbcolor=rgb)    #Case where x_1 != x_2 return line trough P,R evaluated in Q"  l=(Q[1]-P[1])/(Q[0]-P[0])  f(x) = l * (x - P[0]) + P[1]  return plot(f(x),-length,length,linestyle=style,rgbcolor=rgb) Line 802: Line 803: """ % (bits, p, g, a, g, a, p, (g^a), b, g, b, p, (g^b), (g^b), a, p, """ % (bits, p, g, a, g, a, p, (g^a), b, g, b, p, (g^b), (g^b), a, p,

# 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/

by William Stein

by David Runde

by David Runde

by William Stein

by William Stein

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

by William Stein

## Computing Generalized Bernoulli Numbers

by William Stein (Sage-2.10.3)

## Fundamental Domains of SL_2(ZZ)

by Robert Miller

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