cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A221671 Maximum number of squares in a non-constant arithmetic progression (AP) of length n.

Original entry on oeis.org

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, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12
Offset: 1

Views

Author

Jonathan Sondow, Jan 24 2013

Keywords

Comments

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.
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.
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

Examples

			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).
		

References

  • Andrew Granville, "Squares in arithmetic progressions and infinitely many primes", The American Mathematical Monthly 124, no. 10 (2017), pp. 951-954.

Crossrefs

Programs

  • Mathematica
    (* 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 *)

Formula

a(n) = A193832(n) for n < 53 except for n = 5.
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.)
a(A221672(n)) = n.

A221672 Length of shortest non-constant arithmetic progression (AP) containing n squares.

Original entry on oeis.org

1, 2, 3, 5, 8, 13, 16, 23, 27, 36, 41, 52
Offset: 1

Views

Author

Jonathan Sondow, Jan 28 2013

Keywords

Comments

Same as where records occur in A221671 (maximum number of squares in a non-constant AP of length n).
González-Jiménez and Xarles (2013) conjecture that for n >= 5 the sequence a(n)-1 equals the tail 7, 12, 15, 22, 26, 35, 40, 51, ... of A001318 (generalized pentagonal numbers k*(3*k-1)/2 for k = 0, +-1, +-2, ...). They prove it up to a(12)-1 = 51 = 6*(3*6-1)/2.
See A221671 for additional comments.
Also 8, 13, 16, 23, 27, 36, 41, 52 are where records occur for 8 <= n <= 52 in A193832 (number of squares in the arithmetic progression {24k + 1: 0 <= k <= n-1} [Granville]). - Jonathan Sondow, Dec 15 2017

Examples

			The AP 1, 25, 49 = 1^2, 5^2, 7^2 shows that a(n) = n for n = 1, 2, 3 (see A216869).
By Fermat and Euler, no four squares are in AP, so the AP 49, 169, 289, 409, 529 = 7^2, 13^2, 17^2, 409, 23^2 shows that a(4) = 5 (see Dickson and A216870).
As k*(3*k-1)/2 = 0, 1, 2, 5, 7 for k = 0, +-1, +-2, and 24*k*(3*k-1)/2 + 1 = (6*k-1)^2 is a square, the AP 24*n+1 for the 8 numbers n = 0, 1, ..., 7 contains 5 squares, so a(5) <= 8. González-Jiménez and Xarles (2013) prove a(5) > 7, so a(5) = 8.
		

References

  • L. E. Dickson, History of the Theory of Numbers, Vol. II, Chelsea, New York, 1952, pp. 435-440.

Crossrefs

Formula

A221671(a(n)) = n.
a(n) <= A001318(n)+1. (Proof. As 24*k*(3*k-1)/2 + 1 = (6*k-1)^2, a term in the AP 24*m+1 is a square when m is in A001318. Thus the AP 24*m+1 for m = 0, 1, ..., A001318(n) contains n squares and has length A001318(n)+1.)

A216870 A maximal length five arithmetic progression of squares in a quadratic number field.

Original entry on oeis.org

49, 169, 289, 409, 529
Offset: 1

Views

Author

Jonathan Sondow, Nov 20 2012

Keywords

Comments

Bremner (2102): "Xarles (2011) investigated arithmetic progressions (APs) in number fields, and proved the existence of an upper bound K(d) for the maximal length of an AP of squares in a number field of degree d. He shows that K(2) = 5."
Euler showed that K(1) = 3. See A216869 for the smallest non-constant example. Another example is a(1), a(2), a(3) = 49, 169, 289 = 7^2, 13^2, 17^2.
It is known that K(3) >= 4.

Examples

			a(n) = 7^2, 13^2, 17^2, sqrt(409)^2, 23^2 for n = 1, 2, 3, 4, 5.
		

Crossrefs

Programs

Formula

a(n+1) - a(n) = 120 for n = 1, 2, 3, 4.

A295784 Length of the longest arithmetic progression in squares mod n with slope coprime to n.

Original entry on oeis.org

2, 2, 3, 2, 3, 2, 2, 3, 3, 2, 4, 3, 2, 2, 5, 2, 4, 2, 2, 3, 5, 2, 3, 3, 2, 2, 4, 2, 4, 2, 2, 5, 3, 2, 4, 4, 2, 2, 5, 2, 5, 2, 2, 5, 5, 2, 3, 3, 2, 2, 6, 2, 3, 2, 2, 4, 5, 2, 5, 4, 2, 2, 3, 2, 6, 2, 2, 3, 7, 2, 9, 4, 2, 2, 3, 2, 6, 2, 2, 5, 7, 2, 3, 5, 2, 2, 5, 2, 3, 2, 2, 5, 3, 2, 9, 3, 2, 2, 7, 2, 7, 2, 2, 6, 6
Offset: 3

Views

Author

Tom Hejda, Nov 27 2017

Keywords

Comments

The sequence reaches 2 infinitely many times as a(4*n)=2. (If we had a(4*n)>=3, it would imply a(4)>=3, but a(4)=2. This comes from the fact that a(m*n)<=a(m) for m,n>=3.)

Examples

			For n=17 we have residues {0,1,2,4,8,9,13,15,16} and the following arithmetic progressions of length 5: (15, 16, 0, 1, 2), (13, 15, 0, 2, 4), (9, 13, 0, 4, 8)
		

Crossrefs

Bounded by A000224.
Cf. A216869.

Programs

  • SageMath
    def a(n) :
        if n in [1,2] : return Infinity
        R = quadratic_residues(n)
        return max( next( m for m in itertools.count() if (a+(b-a)*m)%n not in R ) \
          for a,b in zip(R,R[1:]+R[:1]) if gcd(b-a,n) == 1 )
Showing 1-4 of 4 results.