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.
%I A164098 #17 Jan 27 2025 02:21:53 %S A164098 1,4,9,10,16,18,20,25,26,27,28,33,34,36,40,42,48,49,50,51,52,54,55,57, %T A164098 58,60,63,64,65,66,68,70,72,74,76,78,80,81,82,84,85,87,88,90,91,92,95, %U A164098 99,100,102,104,105,106,108,110,112,114,115,116,120,121,122,123,124,125 %N A164098 Numbers of the form m * (k_1^2 + k_2^2 + ... + k_m^2). %C A164098 From _Franklin T. Adams-Watters_, Aug 29 2009: (Start) %C A164098 The k_i must all be positive integers. %C A164098 Note that every integer > 33 is the sum of 5 positive squares, and for n > 5, every integer > n+13 is the sum of n positive squares. (End) %C A164098 The complement of this sequence includes: A000040, A037074, A143206, 2 * A002145, and 3 * A094712. - _Robert Israel_, Jan 27 2025 %H A164098 Robert Israel, <a href="/A164098/b164098.txt">Table of n, a(n) for n = 1..10000</a> %e A164098 34 = 2*(4^2 + 1^2), 42 = 3*(3^2 + 2^2 + 1^2), thus 34 and 42 are in the sequence. %p A164098 g:= proc(y,m) %p A164098 # can we write y as sum of m positive squares? %p A164098 option remember; %p A164098 local x; %p A164098 if y < m then return false fi; %p A164098 if m = 1 then return issqr(y) fi; %p A164098 if issqr(y-m+1) then return true fi; %p A164098 for x from 1 while x^2 + m-1 < y do %p A164098 if procname(y-x^2,m-1) then return true fi %p A164098 od; %p A164098 false %p A164098 end proc: %p A164098 filter:= proc(n) %p A164098 ormap(t -> g(n/t, t), numtheory:-divisors(n)) %p A164098 end proc: %p A164098 select(filter, [$1..1000]); # _Robert Israel_, Jan 26 2025 %o A164098 (PARI) issumsqs(n,k) = if(n<=0||k<=0,return(k==0&&n==0)); forstep(j=sqrtint(n),max(sqrtint(n\k),1),-1,if(issumsqs(n-j^2,k-1),return(1)));0 %o A164098 isa(n)=local(ds);ds=divisors(n);for(k=1,(#ds+1)\2,if(issumsqs(n\ds[k],ds[k]),return(1)));0 %o A164098 for(n=1,200,if(isa(n),print1(n","))) \\ _Franklin T. Adams-Watters_, Aug 29 2009 %Y A164098 Cf. A000290, A000404, A000408, A000414, A047700, A111178. [From _Franklin T. Adams-Watters_, Aug 29 2009] %Y A164098 Cf. A000040, A002145, A037074, A094712, A143206. %K A164098 nonn %O A164098 1,2 %A A164098 _Jonas Wallgren_, Aug 10 2009, Aug 17 2009 %E A164098 More terms from _Franklin T. Adams-Watters_, Aug 29 2009