%I M4067 #40 May 02 2024 04:31:53
%S 6,8,10,12,16,18,20,24,26,33,32,36,42,46,48,50,52,53,60,66,68,74,78,
%T 82,90,92,97,100,104,106,114,118,120,126,136,140,144,148,150,156,166,
%U 170,172,172,176,184,186,198,200,206,214,218,222,226,232,234,246,248,252,256,268,282
%N Maximal number of rational points on a curve of genus 2 over GF(q), where q = A246655(n) is the n-th prime power > 1.
%C The successive values of q are 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, ... (see A246655).
%D J. W. P. Hirschfeld, Linear codes and algebraic curves, pp. 35-53 of F. C. Holroyd and R. J. Wilson, editors, Geometrical Combinatorics. Pitman, Boston, 1984. See N_q(2) on page 51.
%D J.-P. Serre, Oeuvres, vol. 3, pp. 658-663 and 664-669.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Robin Visser, <a href="/A005525/b005525.txt">Table of n, a(n) for n = 1..10000</a>
%H Jean-Pierre Serre, <a href="https://gallica.bnf.fr/ark:/12148/bpt6k55351747/f35.item">Sur le nombre des points rationnels d'une courbe algébrique sur un corps fini</a>, C. R. Acad. Sci. Paris Ser. I Math. 296 (1983), no. 9, 397-402.
%H W. C. Waterhouse, <a href="https://doi.org/10.24033/asens.1183">Abelian varieties over finite fields</a>, Ann Sci. E.N.S., (4) 2 (1969), 521-560.
%F a(n) <= q + 1 + 4*sqrt(q) where q = A246655(n) [Hasse-Weil theorem]. - _Robin Visser_, Aug 03 2023
%F a(n) >= q - 1 + 2*floor(2*sqrt(q)) for all n except for 3 and 7, where q = A246655(n) [Serre]. - _Robin Visser_, Aug 03 2023
%e a(2) = 8 because 8 is the maximal number of rational points on a genus 2 curve over GF(3). One example of such a maximal curve is the genus 2 curve y^2 = x^6 + 2*x^2 + 1 which consists of the rational points (x,y) = (0, 1), (0, 2), (1, 1), (1, 2), (1, 1), (1, 2), and two points at infinity. - _Robin Visser_, Aug 03 2023
%o (Sage)
%o for q in range(1, 1000):
%o if Integer(q).is_prime_power():
%o p = Integer(q).prime_factors()[0]
%o if q==4: print(10)
%o elif q==9: print(20)
%o elif (Integer(q).is_square()): print(q + 1 + 4*sqrt(q))
%o elif ((floor(2*sqrt(q))%p == 0) or (q-1).is_square()
%o or (4*q-3).is_square() or (4*q-7).is_square()):
%o if (frac(2*sqrt(q)) > ((sqrt(5)-1)/2)): print(q + 2*floor(2*sqrt(q)))
%o else: print(q + 2*floor(2*sqrt(q)) - 1)
%o else: print(q + 1 + 2*floor(2*sqrt(q))) # _Robin Visser_, Aug 03 2023
%Y Cf. A005523.
%K nonn,easy,nice
%O 1,1
%A _N. J. A. Sloane_
%E More terms from _Robin Visser_, Aug 03 2023