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!)
A316491 Number of ways to represent 8*n + 4 as the sum of four distinct odd squares. 1

%I #18 May 30 2021 11:11:12

%S 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,2,1,0,1,0,1,2,1,0,2,1,1,2,3,0,

%T 2,2,0,3,2,2,3,1,2,2,2,3,3,4,0,4,3,0,6,3,3,4,3,1,4,4,3,4,4,2,6,4,3,6,

%U 3,3,6,4,3,7,5,4,5,6,1,6,6,2,10,4,5,7,5

%N Number of ways to represent 8*n + 4 as the sum of four distinct odd squares.

%C Every odd square is a number of the form 8*k + 1, so every sum of four odd squares is a number of the form 8*k + 4.

%C A316489 lists all positive numbers of the form 8*k + 4 that cannot be expressed as the sum of four distinct odd squares; for each such number, a(k)=0.

%C A316834 lists all numbers that can be expressed in only one way as the sum of four distinct odd squares; each such number is of the form 8*k + 4, and for each such number, a(k)=1.

%H Robert Israel, <a href="/A316491/b316491.txt">Table of n, a(n) for n = 0..10000</a>

%e n=1: 8*1 + 4 = 12 cannot be expressed as the sum of four distinct odd squares, so a(1)=0.

%e n=10: 8*10 + 4 = 84 can be expressed as the sum of four distinct odd squares in only 1 way (84 = 1^2 + 3^2 + 5^2 + 7^2), so a(10)=1.

%e n=19: 8*19 + 4 = 156 can be expressed as the sum of four distinct odd squares in exactly 2 ways (156 = 1^2 + 3^2 + 5^2 + 11^2 = 1^2 + 5^2 + 7^2 + 9^2), so a(19)=2.

%p b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),

%p `if`(min(i, t)<1, 0, b(n, i-2, t)+

%p `if`(i^2>n, 0, b(n-i^2, i-2, t-1))))

%p end:

%p a:= n-> (m-> b(m, (r-> r+1-irem(r, 2))(isqrt(m)), 4))(8*n+4):

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Aug 05 2018

%t a[n_] := Count[ IntegerPartitions[8 n + 4, {4}, Range[1, Sqrt[8 n + 4], 2]^2], w_ /; Max@Differences@w < 0]; Array[a, 87, 0] (* _Giovanni Resta_, Aug 12 2018 *)

%t b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0],

%t If[Min[i, t] < 1, 0, b[n, i-2, t] +

%t If[i^2 > n, 0, b[n-i^2, i-2, t-1]]]];

%t a[n_] := Function[m, b[m, Function[r, r+1-Mod[r, 2]][Floor@Sqrt[m]], 4]][8n+4];

%t a /@ Range[0, 100] (* _Jean-François Alcover_, May 30 2021, after _Alois P. Heinz_ *)

%Y Cf. A316834, A316489, A316490.

%K nonn

%O 0,20

%A _Jon E. Schoenfield_, Jul 29 2018

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 25 06:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)