@@ -1991,6 +1991,14 @@ def _multiple_x_numerator(self, n, x=None):
1991
1991
1992
1992
EXAMPLES::
1993
1993
1994
+ sage: E = EllipticCurve([1,2])
1995
+ sage: E._multiple_x_numerator(3)
1996
+ x^9 - 12*x^7 - 192*x^6 + 30*x^5 - 48*x^4 + 228*x^3 + 96*x^2 + 393*x + 528
1997
+ sage: E._multiple_x_numerator(-3)
1998
+ x^9 - 12*x^7 - 192*x^6 + 30*x^5 - 48*x^4 + 228*x^3 + 96*x^2 + 393*x + 528
1999
+
2000
+ ::
2001
+
1994
2002
sage: E = EllipticCurve("37a")
1995
2003
sage: P = E.gens()[0]
1996
2004
sage: x = P[0]
@@ -2043,9 +2051,9 @@ def _multiple_x_numerator(self, n, x=None):
2043
2051
sage: E._multiple_x_numerator(5)
2044
2052
x^25 + 65037*x^23 + 55137*x^22 + ... + 813*x^2 + 10220*x + 42539
2045
2053
"""
2046
- n = rings .Integer (n )
2047
- if n < 2 :
2048
- raise ValueError ("n must be at least 2 " )
2054
+ n = rings .Integer (n ). abs ()
2055
+ if not n :
2056
+ raise ValueError ("n must be nonzero " )
2049
2057
2050
2058
if x is None :
2051
2059
try :
@@ -2061,6 +2069,9 @@ def _multiple_x_numerator(self, n, x=None):
2061
2069
cache = None
2062
2070
xx = x
2063
2071
2072
+ if n == 1 :
2073
+ return xx
2074
+
2064
2075
polys = self .division_polynomial_0 ([- 2 ,- 1 ,n - 1 ,n ,n + 1 ], x )
2065
2076
2066
2077
if n % 2 == 0 :
@@ -2101,6 +2112,14 @@ def _multiple_x_denominator(self, n, x=None):
2101
2112
2102
2113
EXAMPLES::
2103
2114
2115
+ sage: E = EllipticCurve([1,2])
2116
+ sage: E._multiple_x_denominator(3)
2117
+ 9*x^8 + 36*x^6 + 144*x^5 + 30*x^4 + 288*x^3 + 564*x^2 - 48*x + 1
2118
+ sage: E._multiple_x_denominator(-3)
2119
+ 9*x^8 + 36*x^6 + 144*x^5 + 30*x^4 + 288*x^3 + 564*x^2 - 48*x + 1
2120
+
2121
+ ::
2122
+
2104
2123
sage: E = EllipticCurve("43a")
2105
2124
sage: P = E.gens()[0]
2106
2125
sage: x = P[0]
@@ -2128,9 +2147,9 @@ def _multiple_x_denominator(self, n, x=None):
2128
2147
sage: E._multiple_x_denominator(5)
2129
2148
25*x^24 + 3100*x^22 + 19000*x^21 + ... + 24111*x^2 + 52039*x + 56726
2130
2149
"""
2131
- n = rings .Integer (n )
2132
- if n < 2 :
2133
- raise ValueError ("n must be at least 2 " )
2150
+ n = rings .Integer (n ). abs ()
2151
+ if not n :
2152
+ raise ValueError ("n must be nonzero " )
2134
2153
2135
2154
if x is None :
2136
2155
try :
0 commit comments