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.

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

This page as a plain text file.
%I A305884 #21 Jul 22 2018 06:54:58
%S A305884 1,1,1,4,16,25,25,324,841,1849,2601,14884,18769,103041,292681,774400,
%T A305884 3400336,13307904,34892649,179399236,582643044,2008473856,4369606609,
%U A305884 22833627664,67113119844,251608579236,1240247504896,3174109249609
%N A305884 Lexicographically first sequence of positive squares, no two or more of which sum to a square.
%C A305884 Conjecture: the only values that appear more than once are 1 and 25.
%C A305884 If it were required that the terms be distinct, A306043 would result.
%e A305884 All terms are positive, so a(1) = 1; likewise, a(2) = a(3) = 1.
%e A305884 a(4) cannot be 1, because the first 4 terms would then sum to 4 = 2^2; however, no two or more terms of {1, 1, 1, 4} sum to a square, so a(4) = 4.
%e A305884 a(5) cannot also be 4, because 4 + 4 + 1 = 9 = 3^2, nor can it be 9, since 9 + 4 + 1 + 1 + 1 = 16 = 4^2, but a(5) = 16 satisfies the definition.
%t A305884 a = {1}; Do[n = Last@a; s = Select[Union[Total /@ Subsets[a^2]], # >= n &];
%t A305884 While[AnyTrue[s, IntegerQ@ Sqrt[n^2 + #] &], n++]; AppendTo[a, n], {14}]; a^2 (* _Giovanni Resta_, Jun 14 2018 *)
%o A305884 (Python)
%o A305884 from sympy import integer_nthroot
%o A305884 from sympy.utilities.iterables import multiset_combinations
%o A305884 A305884_list, n, m = [], 1, 1
%o A305884 while len(A305884_list) < 30:
%o A305884     for l in range(1,len(A305884_list)+1):
%o A305884         for d in multiset_combinations(A305884_list,l):
%o A305884             if integer_nthroot(sum(d)+m,2)[1]:
%o A305884                 break
%o A305884         else:
%o A305884             continue
%o A305884         break
%o A305884     else:
%o A305884         A305884_list.append(m)
%o A305884         continue
%o A305884     n += 1
%o A305884     m += 2*n-1 # _Chai Wah Wu_, Jun 19 2018
%Y A305884 Cf. A000290, A064776, A306043.
%K A305884 nonn,more
%O A305884 1,4
%A A305884 _Jon E. Schoenfield_, Jun 13 2018
%E A305884 a(25)-a(26) from _Giovanni Resta_, Jun 14 2018
%E A305884 a(27)-a(28) from _Jon E. Schoenfield_, Jul 21 2018