p を法とする楕円曲線上の点の数(2)
y^2 + y = x^3 - x^2,
y^2 + y = x^3 - x^2 - 10x - 20,
y^2 + y = x^3 - x^2 - 7820x - 263580
これらについて、p を法とする楕円曲線上の点の数を求め、
それぞれが一致することを確認してみた。
require 'prime'
def A(a3, a2, a4, a6, n)
ary = []
Prime.take(n).each{|p|
a = Array.new(p, 0)
(0..p - 1).each{|i| a[(i * i + a3 * i) % p] += 1}
ary << (0..p - 1).inject(0){|s, i| s + a[(i * i * i + a2 * i * i + a4 * i + a6) % p]}
}
ary
end
n = 500
p ary = A(1, -1, 0, 0, n)
p ary == A(1, -1, -10, -20, n)
p ary == A(1, -1, -7820, -263580, n)
出力結果
[4, 4, 4, 9, 10, 9, 19, 19, 24, 29, 24, 34, 49, 49, 39, 59, 54, 49, 74, 74, 69, 89, 89, 74, 104, 99, 119, 89, 99, 104, 119, 149, 144, 129, 159, 149, 164, 159, 179, 179, 194, 174, 174, 189, 199, 199, 199, 204, 209, 214, 209, 269, 249, 274, 259, 249, 259, 299, 279, 299, 279, 269, 299, 299, 314, 304, 324, 359, 319, 319, 374, 379, 384, 399, 384, 384, 404, 399, 399, 439, 399, 399, 449, 444, 399, 454, 414, 469, 449, 474, 494, 459, 464, 499, 479, 529, 494, 524, 539, 549, 539, 559, 559, 569, 599, 544, 559, 549, 559, 599, 629, 629, 599, 644, 624, 674, 614, 654, 694, 649, 624, 659, 719, 699, 674, 699, 734, 704, 724, 769, 689, 739, 774, 779, 749, 749, 779, 819, 744, 809, 849, 799, 784, 879, 804, 844, 839, 849, 874, 839, 889, 924, 879, 909, 919, 899, 909, 959, 929, 899, 974, 919, 999, 924, 1004, 944, 999, 959, 1019, 974, 1029, 999, 999, 1049, 1034, 1104, 1049, 1074, 1019, 1089, 1079, 1149, 1144, 1139, 1154, 1139, 1069, 1099, 1079, 1149, 1184, 1129, 1174, 1199, 1199, 1214, 1199, 1254, 1259, 1209, 1169, 1249, 1219, 1209, 1284, 1324, 1294, 1319, 1289, 1299, 1249, 1274, 1264, 1279, 1349, 1274, 1259, 1349, 1439, 1334, 1449, 1339, 1424, 1394, 1439, 1499, 1379, 1439, 1419, 1399, 1524, 1479, 1449, 1449, 1434, 1429, 1504, 1529, 1444, 1474, 1564, 1499, 1579, 1564, 1609, 1619, 1619, 1599, 1609, 1549, 1629, 1599, 1574, 1619, 1619, 1639, 1599, 1549, 1604, 1659, 1659, 1619, 1619, 1699, 1739, 1659, 1754, 1724, 1769, 1739, 1724, 1804, 1719, 1799, 1769, 1724, 1844, 1779, 1749, 1799, 1879, 1874, 1899, 1799, 1839, 1874, 1879, 1859, 1914, 1819, 1824, 1959, 1949, 1949, 1879, 1989, 1974, 1894, 1949, 2009, 2059, 2069, 2019, 1999, 2024, 2034, 1964, 1984, 1979, 1969, 2039, 1999, 2099, 1994, 2039, 2099, 2064, 2149, 2199, 2109, 2199, 2064, 2199, 2234, 2179, 2174, 2224, 2204, 2159, 2209, 2199, 2159, 2309, 2299, 2299, 2174, 2244, 2269, 2274, 2249, 2264, 2354, 2249, 2324, 2274, 2329, 2274, 2384, 2399, 2414, 2399, 2374, 2399, 2419, 2439, 2339, 2474, 2349, 2439, 2454, 2519, 2399, 2444, 2509, 2464, 2484, 2429, 2489, 2449, 2474, 2539, 2509, 2569, 2649, 2544, 2559, 2649, 2579, 2639, 2599, 2599, 2594, 2609, 2619, 2619, 2624, 2599, 2684, 2699, 2664, 2684, 2734, 2754, 2724, 2624, 2769, 2789, 2699, 2799, 2799, 2699, 2704, 2719, 2819, 2809, 2749, 2839, 2749, 2759, 2844, 2839, 2899, 2839, 2849, 2939, 2924, 2919, 2944, 2859, 2849, 2934, 2829, 2999, 2989, 3039, 2954, 3044, 2899, 3024, 3079, 2974, 2949, 2934, 2984, 3024, 2999, 3089, 3024, 3054, 3099, 3054, 3064, 3029, 3209, 3099, 3129, 3189, 3149, 3124, 3149, 3189, 3199, 3209, 3219, 3194, 3324, 3159, 3299, 3179, 3199, 3319, 3274, 3199, 3374, 3209, 3309, 3319, 3399, 3429, 3374, 3299, 3364, 3404, 3449, 3474, 3369, 3374, 3299, 3389, 3404, 3499, 3409, 3514, 3499, 3559, 3429, 3554, 3474, 3399, 3499, 3539, 3509, 3564, 3509, 3519, 3499, 3494, 3584, 3559, 3599]
true
true
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。