OFFSET
1,2
COMMENTS
If the squares were not required to be distinct, sequence A305884 would result.
EXAMPLE
All terms are distinct positive squares, and no two or more of the first three positive squares sum to a square, so a(1) = 1^2 = 1, a(2) = 2^2 = 4, and a(3) = 3^2 = 9.
a(4) cannot be 16, because 16 + a(3) = 16 + 9 = 25 = 5^2, but a(4) = 25 satisfies the definition.
a(5) cannot be 36, because 36 + 9 + 4 = 49 = 7^2, but a(5) = 49 satisfies the definition.
MATHEMATICA
a = {1}; Do[n = 1 + Last@a; s = Select[Union[Total /@ Subsets[a^2]], # >= n &]; While[AnyTrue[s, IntegerQ@Sqrt[n^2 + #] &], n++]; AppendTo[a, n], {12}]; a^2 (* Giovanni Resta, Jun 19 2018 *)
PROG
(Python)
from itertools import combinations
from sympy import integer_nthroot
A306043_list, n, m = [], 1, 1
while len(A306043_list) < 30:
for l in range(1, len(A306043_list)+1):
for d in combinations(A306043_list, l):
if integer_nthroot(sum(d)+m, 2)[1]:
break
else:
continue
break
else:
A306043_list.append(m)
n += 1
m += 2*n-1 # Chai Wah Wu, Jun 19 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon E. Schoenfield, Jun 17 2018
EXTENSIONS
a(24)-a(26) from Giovanni Resta, Jun 19 2018
a(27)-a(28) from Jon E. Schoenfield, Jul 21 2018
STATUS
approved