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.

A346163 Numbers k such that there exist equal sums of k and 2k consecutive positive squares.

Original entry on oeis.org

1, 17, 23, 25, 49, 55, 71, 73, 79, 89, 95, 103, 113, 127, 143, 161, 167, 175, 185, 191, 193, 199, 215, 217, 233, 239, 241, 265, 271, 287, 289, 305, 361, 377, 391, 409, 415, 431, 433, 457, 473, 481, 505, 511, 521, 535, 545, 553, 569, 593, 599, 617, 631, 647
Offset: 1

Views

Author

Johan Westin, Jul 08 2021

Keywords

Comments

a(n) is congruent to 1 or 5 (mod 6).
a(n) is not congruent to 3, 4 or 5 (mod 8) or to 7, 11, 16 or 20 (mod 27), see Alder and Alfred.
k is in the sequence if the quadratic Diophantine equation 6*(k*x^2 - 2*k*y^2 + k*(k-1)*x + 2*k*(1-2*k)*y) - 14*k^3 + 9*k^2 - k = 0 has solutions x, y in the positive integers.

Examples

			a(1): 5^2 = 3^2 + 4^2. Here the left-hand side has k = 1 term, and the right-hand side has 2k = 2 terms. Hence k = 1 is in the sequence.
a(2): 29^2 + 30^2 + ... + 44^2 + 45^2 = 8^2 + 9^2 + ... + 40^2 + 41^2 = 23681. Here the left and right sums have k = 17 and 2k = 34 terms, respectively. Hence k = 17 is in the sequence.
		

Crossrefs

Programs

  • Python
    import sympy # Version 1.8
    xx, yy = sympy.symbols("x y")
    def pyramidal(n):
        return n*(n+1)*(2*n+1)/6 # A000330(n)
    def expanded_diophantine(k,n):
        left_hand_side =  pyramidal(xx+n-1) - pyramidal(xx-1)
        right_hand_side =  pyramidal(yy+n+k-1) - pyramidal(yy-1)
        return sympy.expand(right_hand_side-left_hand_side)
    def has_solutions(k,n):
        return len(sympy.solvers.diophantine(expanded_diophantine(k,n))) != 0
    def k_in_a346163(k):
        return has_solutions(k,k)