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.

A306043 Lexicographically first sequence of distinct positive squares, no two or more of which sum to a square.

This page as a plain text file.
%I A306043 #22 Jul 21 2018 07:53:26
%S A306043 1,4,9,25,49,64,484,625,1225,2209,12100,57600,67600,287296,1517824,
%T A306043 7452900,19492225,64352484,161391616,976375009,3339684100,9758278656,
%U A306043 33371982400,81598207716,448192758784,1641916765129,4148028762241,23794464493849
%N A306043 Lexicographically first sequence of distinct positive squares, no two or more of which sum to a square.
%C A306043 If the squares were not required to be distinct, sequence A305884 would result.
%e A306043 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.
%e A306043 a(4) cannot be 16, because 16 + a(3) = 16 + 9 = 25 = 5^2, but a(4) = 25 satisfies the definition.
%e A306043 a(5) cannot be 36, because 36 + 9 + 4 = 49 = 7^2, but a(5) = 49 satisfies the definition.
%t A306043 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 *)
%o A306043 (Python)
%o A306043 from itertools import combinations
%o A306043 from sympy import integer_nthroot
%o A306043 A306043_list, n, m = [], 1, 1
%o A306043 while len(A306043_list) < 30:
%o A306043     for l in range(1,len(A306043_list)+1):
%o A306043         for d in combinations(A306043_list,l):
%o A306043             if integer_nthroot(sum(d)+m,2)[1]:
%o A306043                 break
%o A306043         else:
%o A306043             continue
%o A306043         break
%o A306043     else:
%o A306043         A306043_list.append(m)
%o A306043     n += 1
%o A306043     m += 2*n-1 # _Chai Wah Wu_, Jun 19 2018
%Y A306043 Cf. A305884.
%K A306043 nonn
%O A306043 1,2
%A A306043 _Jon E. Schoenfield_, Jun 17 2018
%E A306043 a(24)-a(26) from _Giovanni Resta_, Jun 19 2018
%E A306043 a(27)-a(28) from _Jon E. Schoenfield_, Jul 21 2018