OFFSET
1,2
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.
LINKS
H. L. Alder and U. Alfred, n and n+k Consecutive Integers with Equal Sums of Squares, The American Mathematical Monthly, 71:7 (1964), 749-754.
EXAMPLE
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.
PROG
(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)
CROSSREFS
KEYWORD
nonn
AUTHOR
Johan Westin, Jul 08 2021
STATUS
approved