%I #30 Jan 21 2022 23:28:20
%S 1,2,3,3,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7,7,7,7,8,8,8,8,9,9,9,9,9,9,9,9,
%T 9,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,12
%N Maximum number of squares in a non-constant arithmetic progression (AP) of length n.
%C Let s(n;d,i) denote the number of squares in AP i, i+d, i+2d, ..., i+(n-1)d. Then a(n) is the maximum of s(n;d,i) over all such APs with d > 0.
%C González-Jiménez and Xarles (2013) compute a(n) up to a(52) = 12 using elliptic curves (see Table 2, where their Q(N) = a(N)). They do not seem to have noticed that a(n) = A193832(n) for n != 5 in the range where they computed a(n). I conjecture that this formula holds for all n != 5.
%C Bombieri & Zannier prove that a(n) << n^(3/5) (log n)^c for some constant c > 0. It is conjectured that a(n) ~ sqrt(8n/3). - _Charles R Greathouse IV_, Jan 21 2022
%D Andrew Granville, "Squares in arithmetic progressions and infinitely many primes", The American Mathematical Monthly 124, no. 10 (2017), pp. 951-954.
%H Enrico Bombieri and Umberto Zannier, <a href="https://eudml.org/doc/252428">A note on squares in arithmetic progressions, II.</a>, Atti della Accademia Nazionale dei Lincei. Classe di Scienze Fisiche, Matematiche e Naturali. Rendiconti Lincei. Matematica e Applicazioni 13, no. 2 (2002), pp. 69-75.
%H Enrique González-Jiménez and Xavier Xarles, <a href="http://arxiv.org/abs/1301.5122v1">On a conjecture of Rudin on squares in Arithmetic Progressions</a>, arXiv 2013.
%F a(n) = A193832(n) for n < 53 except for n = 5.
%F a(n) >= A193832(n) for all n. (Proof. A193832 equals the partial sums of A080995 (characteristic function of generalized pentagonal numbers A001318) and a term in the AP 1+24*k is a square if and only if k = A001318(x) = x*(3*x-1)/2 for some x. See González-Jiménez and Xarles (2013) Lemma 2.)
%F a(A221672(n)) = n.
%e The AP 1, 25, 49 = 1^2, 5^2, 7^2 shows that a(3) = 3. By Fermat and Euler, no four squares are in AP, so a(4) = 3 (see A216869). Then the AP 49, 169, 289, 409, 529 = 7^2, 13^2, 17^2, 409, 23^2 shows that a(5) = 4 (see A216870).
%t (* note that an extension to more than 52 terms may not be correct *) row[n_] := Join[Table[2*n-1, {2*n-1}], Table[2*n, {n}]]; row[2] = {3, 3, 4, 4, 4}; Flatten[Table[row[n], {n, 1, 6}]][[1 ;; 52]] (* _Jean-François Alcover_, Jan 25 2013, from formula *)
%Y Cf. A001318, A080995, A193832, A216869, A216870, A221672.
%K nonn,hard,more
%O 1,2
%A _Jonathan Sondow_, Jan 24 2013