login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A143574 Sum of all distinct squares occurring when partitioning n into two squares. 5

%I #21 May 16 2023 11:29:06

%S 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 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 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 Sum of all distinct squares occurring when partitioning n into two squares.

%C For n > 0: a(n) = 0 iff A000161(n) = 0: a(A022544(n)) = 0;

%C A143575 gives numbers m such that a(m) = m.

%H Reinhard Zumkeller, <a href="/A143574/b143574.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = Sum_{k=1..n} k*A010052(k)*A010052(n-k). [_Reinhard Zumkeller_, Sep 27 2008]

%e A000161(25)=#{5^2+0^2,4^2+3^2}=2: a(25)=25+0+16+9=50;

%e A000161(26)=#{5^2+1^2}=1: a(16)=25+1=26;

%e A000161(49)=#{7^2+0^2}=1: a(49)=49+0=49;

%e A000161(50)=#{7^2+1^2,5^2+5^2}=2: a(50)=49+1+25=75;

%e 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 A000161(2601)=#{51^2+0^2,45^2+24^2}=2: a(2601)=2601+0+12025+576=5202;

%e A000161(2602)=#{51^2+1^2}=1: a(2602)=2601+1=2602.

%o (Python)

%o from sympy import divisors

%o from sympy.solvers.diophantine.diophantine import cornacchia

%o def A143574(n):

%o c = 0

%o for d in divisors(n):

%o if (k:=d**2)>n:

%o break

%o q, r = divmod(n,k)

%o if not r:

%o 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 return c # _Chai Wah Wu_, May 15 2023

%o (PARI) a(n) = sum(k=1, n, if (issquare(k) && issquare(n-k), k)); \\ _Michel Marcus_, May 16 2023

%Y Cf. A000161, A002654, A010052, A022544, A143575.

%K nonn

%O 0,5

%A _Reinhard Zumkeller_, Aug 24 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 13:41 EDT 2024. Contains 371957 sequences. (Running on oeis4.)