# Problem 4(a)



In [38]:

E = EllipticCurve([0, 1])
for p in primes(0, 200):
if E.has_good_reduction(p):
print p, p % 3, E.ap(p)




5 2 0
7 1 -4
11 2 0
13 1 2
17 2 0
19 1 8
23 2 0
29 2 0
31 1 -4
37 1 -10
41 2 0
43 1 8
47 2 0
53 2 0
59 2 0
61 1 14
67 1 -16
71 2 0
73 1 -10
79 1 -4
83 2 0
89 2 0
97 1 14
101 2 0
103 1 20
107 2 0
109 1 2
113 2 0
127 1 20
131 2 0
137 2 0
139 1 -16
149 2 0
151 1 -4
157 1 14
163 1 8
167 2 0
173 2 0
179 2 0
181 1 26
191 2 0
193 1 2
197 2 0
199 1 -28



It appears that $a_p = 0$ just in case $p \equiv 2 \pmod{3}$. We test this hypothesis below.



In [13]:

E = EllipticCurve([0, 1])
succ = True
for p in primes(0, 2^10):
ap = E.ap(p)
if p % 3 == 2 and ap != 0:
print "Counterexample:", p, ap
succ = False
elif p % 3 == 1 and ap == 0:
print "Counterexample:", p, ap
succ = False
if succ:
print "Success!"




Success!



# Problem 4(b)



In [28]:

E = EllipticCurve([0, 1])
A = E.aplist(2^24)
P = prime_range(0, 2^24)
X = [A[i]/sqrt(RR(P[i])) for i in range(0,len(A))]
for k in [12, 16, 20, 24]:
l = len(prime_range(0, 2^k))
M = [sum([X[i]^n for i in range(0, l)])/l for n in [0..10]]
print M




[1.00000000000000, 0.0191919551375288, 0.974437923028614, 0.0757290006118743, 2.90104856307582, 0.286491303398588, 9.60224623592909, 1.02756951914680, 33.3934539835098, 3.60144887021703, 119.530317596622]
[1.00000000000000, -0.000493074520268084, 0.992040215885212, 0.00177951549630962, 2.96686777872802, 0.0154888359387161, 9.86487486536403, 0.0735642904541910, 34.4539812008748, 0.296684375784803, 123.798757963793]
[1.00000000000000, 0.00180817961697561, 0.998168176351889, 0.00730324795415838, 2.99188913386525, 0.0285562236048521, 9.96615603239180, 0.110063371845773, 34.8623864976199, 0.420665355839438, 125.448278077213]
[1.00000000000000, -0.0000930448718027475, 0.999277215116771, -9.28353894872521e-7, 2.99740396811226, 0.000368674831721141, 9.99007274023070, 0.00201918347864235, 34.9606727131775, 0.00884038388627102, 125.841644174587]



This appears to be $\binom{2m-1}{m}$ for $n = 2m > 0$, $1$ for $n = 0$, and $0$ otherwise. OEIS was used to find this information. We now test $n = 12, 14$.



In [66]:

E = EllipticCurve([0, 1])
A = E.aplist(2^24)
P = prime_range(0, 2^24)
X = [A[i]/sqrt(RR(P[i])) for i in range(0,len(A))]
for k in [12, 16, 20, 24]:
l = len(prime_range(0, 2^k))
M = [sum([X[i]^n for i in range(0, l)])/l for n in [12, 14]]
print M




[436.049752153125, 1612.22730730014]
[453.128240395453, 1680.23994543695]
[459.804981598033, 1707.30329659689]
[461.358022148833, 1713.39106343907]



These appear to be converging to the expected values of $462$ and $1716$.

# Problem 4(c)



In [60]:

for E in map(EllipticCurve, [[-595, 5586], [-608, 5776], [-9504, 365904]]):
print E, factor(E.minimal_model().discriminant())
for p in primes(0, 200):
if E.has_good_reduction(p):
print p, E.ap(p)
print




Elliptic Curve defined by y^2 = x^3 - 595*x + 5586 over Rational Field 2^12 * 7^3
3 0
5 0
11 -4
13 0
17 0
19 0
23 -8
29 2
31 0
37 -6
41 0
43 12
47 0
53 -10
59 0
61 0
67 -4
71 -16
73 0
79 -8
83 0
89 0
97 0
101 0
103 0
107 20
109 18
113 2
127 -16
131 0
137 -10
139 0
149 22
151 24
157 0
163 20
167 0
173 0
179 -4
181 0
191 -8
193 18
197 -26
199 0

Elliptic Curve defined by y^2 = x^3 - 608*x + 5776 over Rational Field -1 * 19^3
2 0
3 0
5 -1
7 3
11 -5
13 0
17 -7
23 -4
29 0
31 0
37 0
41 0
43 -1
47 13
53 0
59 0
61 15
67 0
71 0
73 -11
79 0
83 -16
89 0
97 0
101 10
103 0
107 0
109 0
113 0
127 0
131 -7
137 -23
139 -9
149 -11
151 0
157 18
163 -24
167 0
173 0
179 0
181 0
191 -17
193 0
197 22
199 -25

Elliptic Curve defined by y^2 = x^3 - 9504*x + 365904 over Rational Field -1 * 11^3
2 0
3 -1
5 -3
7 0
13 0
17 0
19 0
23 -9
29 0
31 -5
37 7
41 0
43 0
47 -12
53 6
59 -15
61 0
67 13
71 -3
73 0
79 0
83 0
89 -9
97 17
101 0
103 -4
107 0
109 0
113 21
127 0
131 0
137 -3
139 0
149 0
151 0
157 -23
163 -16
167 0
173 0
179 21
181 -25
191 -15
193 0
197 0
199 -20



From OEIS, it appears that $a_p = 0$ when either $p = 2$ or $p$ is nonsquare modulo $7$, $19$, and $11$, respectively. These are the least odd primes at which the curves have poor reduction, i.e. the least odd primes dividing the discriminants of the minimal models of the curves. We check this below.



In [63]:

succ = True
for E in map(EllipticCurve, [[-595, 5586], [-608, 5776], [-9504, 365904]]):
disc = dict(factor(E.minimal_model().discriminant()))
disc[2] = None
del disc[2]
mp = min(disc.keys())
for p in primes(3, 2^10):
ap = E.ap(p)
if kronecker(p, mp) == -1 and ap != 0:
print "Counterexample:", E, p, ap
succ = False
elif kronecker(p, mp) == 1 and ap == 0:
print "Counterexample:", E, p, ap
succ = False
if succ:
print "Success!"




Success!



We now look at the moment statistics.



In [64]:

P = prime_range(0, 2^24)
for E in map(EllipticCurve, [[-595, 5586], [-608, 5776], [-9504, 365904]]):
A = E.aplist(2^24)
X = [A[i]/sqrt(RR(P[i])) for i in range(0,len(A))]
M = [sum([a^n for a in X])/len(X) for n in [0..10]]
print M




[1.00000000000000, -0.0000389890638436595, 0.999491768852443, -0.000377471603887925, 2.99795542984206, -0.00223916739547783, 9.99170973896100, -0.00964365679300189, 34.9666969045547, -0.0371675962124562, 125.867067930583]
[1.00000000000000, -0.000502205287382821, 0.999356622707972, -0.00209939078938414, 2.99768585503490, -0.00831945091035449, 9.99124903323378, -0.0317300509174316, 34.9655028307217, -0.120136563211470, 125.861090164879]
[1.00000000000000, -0.000379049989050029, 0.999845806212390, -0.000691855226226293, 2.99915147773717, -0.00160639708638816, 9.99630832228896, -0.00459826220963397, 34.9845690126885, -0.0155903098033883, 125.936347263222]



These indeed appear to converge to the same sequence conjectured in (b).

# Problem 4(d)



In [71]:

idn = 4072
E1 = EllipticCurve([-595, 5586])
for p in primes(0, 200):
if E1.has_good_reduction(p):
print p, E1.ap(p), E2.ap(p), kronecker(idn, p)
A = E.aplist(2^24)
X = [A[i]/sqrt(RR(P[i])) for i in range(0,len(A))]
M = [sum([a^n for a in X])/len(X) for n in [0..10]]
print M




3 0 0 1
5 0 0 -1
11 -4 4 -1
13 0 0 1
17 0 0 1
19 0 0 1
23 -8 -8 1
29 2 -2 -1
31 0 0 -1
37 -6 6 -1
41 0 0 -1
43 12 -12 -1
47 0 0 -1
53 -10 -10 1
59 0 0 1
61 0 0 1
67 -4 4 -1
71 -16 -16 1
73 0 0 1
79 -8 8 -1
83 0 0 -1
89 0 0 1
97 0 0 1
101 0 0 -1
103 0 0 1
107 20 -20 -1
109 18 -18 -1
113 2 2 1
127 -16 -16 1
131 0 0 1
137 -10 -10 1
139 0 0 1
149 22 22 1
151 24 -24 -1
157 0 0 1
163 20 20 1
167 0 0 1
173 0 0 -1
179 -4 4 -1
181 0 0 -1
191 -8 8 -1
193 18 -18 -1
197 -26 -26 1
199 0 0 1
[1.00000000000000, -0.000259025305365256, 0.999491768852443, -0.00247659179853461, 2.99795542984206, -0.0107804555595267, 9.99170973896100, -0.0431550542461821, 34.9666969045547, -0.169402330301520, 125.867067930583]



The values of $a_p$ appear to be the same, except negated when $4072$ is not a square modulo $p$. The moment statistics are approximately the same.