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.

A241898 a(n) is the largest integer such that n = a(n)^2 + ... is a decomposition of n into a sum of at most four nondecreasing squares.

This page as a plain text file.
%I A241898 #48 May 25 2014 19:13:46
%S A241898 1,1,1,2,1,1,1,2,3,1,1,2,2,1,1,4,2,3,1,2,2,2,1,2,5,2,3,2,2,1,2,4,2,3,
%T A241898 1,6,2,2,1,2,4,2,3,2,3,1,2,4,7,5,1,4,2,3,1,2,4,3,3,2,5,2,3,8,4,4,3,4,
%U A241898 2,3,2,6,4,5,5,3,4,2,3,4,9,4,3,4,6,5,2
%N A241898 a(n) is the largest integer such that n = a(n)^2 + ... is a decomposition of n into a sum of at most four nondecreasing squares.
%C A241898 This differs from A191090 only for n>=30 because 30 cannot be written as a sum of at most four squares without using 1^2, but 30 can be written as a sum of five nondecreasing squares: 2^2 + 2^2 + 2^2 + 3^2 + 3^2, making A191090(30)=2.
%C A241898 By Lagrange's Theorem every number can be written as a sum of four squares.  Can the same be said of the set of {a^2|a is any integer not equal to 7}? From the data that I have, it would seem that a(n) is greater than 7 for all n>599.  If this could be proved, it would only remain to check if all the numbers up to 599 can be written as the sum of 4 squares none of which is 7^2.
%H A241898 Alois P. Heinz, <a href="/A241898/b241898.txt">Table of n, a(n) for n = 1..10000</a>
%e A241898 30 can be written as the sum of at most 4 nondecreasing squares in the following ways: 1^2 + 2^2 + 5^2 or 1^2 + 2^2 + 3^2 + 4^2. Therefore, a(30)=1.
%p A241898 b:= proc(n, i, t) option remember; n=0 or t>0 and
%p A241898        i^2<=n and (b(n, i+1, t) or b(n-i^2, i, t-1))
%p A241898     end:
%p A241898 a:= proc(n) local k;
%p A241898       for k from isqrt(n) by -1 do
%p A241898         if b(n, k, 4) then return k fi
%p A241898       od
%p A241898     end:
%p A241898 seq(a(n), n=1..100);  # _Alois P. Heinz_, May 25 2014
%t A241898 For[i=0,i<=7^4,i++,a[i]={}];
%t A241898 For[i1=0,i1<=7,i1++,
%t A241898 For[i2=0,i2<=7,i2++,
%t A241898 For[i3=0,i3<=7,i3++,
%t A241898 For[i4=0,i4<=7,i4++,
%t A241898 sumOfSquares=i1^2+i2^2+i3^2+i4^2;
%t A241898 smallestSquare=Min[DeleteCases[{i1,i2,i3,i4},0]];
%t A241898 a[sumOfSquares]=Union[{smallestSquare},a[sumOfSquares]] ]]]];
%t A241898 Table[Max[a[i]],{i,1,50}]
%Y A241898 Cf. A191090.
%K A241898 nonn,look
%O A241898 1,4
%A A241898 _Moshe Shmuel Newman_, May 15 2014