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 A143574 #21 May 16 2023 11:29:06 %S A143574 0,1,1,0,4,5,0,0,4,9,10,0,0,13,0,0,16,17,9,0,20,0,0,0,0,50,26,0,0,29, %T A143574 0,0,16,0,34,0,36,37,0,0,40,41,0,0,0,45,0,0,0,49,75,0,52,53,0,0,0,0, %U A143574 58,0,0,61,0,0,64,130,0,0,68,0,0,0,36,73,74,0,0,0,0,0,80,81,82,0,0,170,0,0,0 %N A143574 Sum of all distinct squares occurring when partitioning n into two squares. %C A143574 For n > 0: a(n) = 0 iff A000161(n) = 0: a(A022544(n)) = 0; %C A143574 A143575 gives numbers m such that a(m) = m. %H A143574 Reinhard Zumkeller, <a href="/A143574/b143574.txt">Table of n, a(n) for n = 0..10000</a> %F A143574 a(n) = Sum_{k=1..n} k*A010052(k)*A010052(n-k). [_Reinhard Zumkeller_, Sep 27 2008] %e A143574 A000161(25)=#{5^2+0^2,4^2+3^2}=2: a(25)=25+0+16+9=50; %e A143574 A000161(26)=#{5^2+1^2}=1: a(16)=25+1=26; %e A143574 A000161(49)=#{7^2+0^2}=1: a(49)=49+0=49; %e A143574 A000161(50)=#{7^2+1^2,5^2+5^2}=2: a(50)=49+1+25=75; %e A143574 A000161(2600)=#{50^2+10^2,46^2+22^2,38^2+34^2}=3: a(2600)=2500+100+2116+484+1444+1156=7800; %e A143574 A000161(2601)=#{51^2+0^2,45^2+24^2}=2: a(2601)=2601+0+12025+576=5202; %e A143574 A000161(2602)=#{51^2+1^2}=1: a(2602)=2601+1=2602. %o A143574 (Python) %o A143574 from sympy import divisors %o A143574 from sympy.solvers.diophantine.diophantine import cornacchia %o A143574 def A143574(n): %o A143574 c = 0 %o A143574 for d in divisors(n): %o A143574 if (k:=d**2)>n: %o A143574 break %o A143574 q, r = divmod(n,k) %o A143574 if not r: %o A143574 c += sum(k*(a[0]**2+(a[1]**2 if a[0]!=a[1] else 0)) for a in cornacchia(1,1,q) or []) %o A143574 return c # _Chai Wah Wu_, May 15 2023 %o A143574 (PARI) a(n) = sum(k=1, n, if (issquare(k) && issquare(n-k), k)); \\ _Michel Marcus_, May 16 2023 %Y A143574 Cf. A000161, A002654, A010052, A022544, A143575. %K A143574 nonn %O A143574 0,5 %A A143574 _Reinhard Zumkeller_, Aug 24 2008