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!)
A339430 Number of compositions (ordered partitions) of n into an even number of distinct squares. 2

%I #13 Mar 09 2021 05:01:44

%S 1,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,0,2,0,0,2,0,0,0,0,2,2,0,0,2,24,0,0,0,

%T 2,0,0,2,0,24,2,2,0,0,0,2,24,0,0,0,26,24,2,2,24,0,0,24,2,0,0,2,24,24,

%U 0,28,24,0,2,0,24,24,0,2,26,24,0,0,72,24,2

%N Number of compositions (ordered partitions) of n into an even number of distinct squares.

%H Alois P. Heinz, <a href="/A339430/b339430.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Com#comp">Index entries for sequences related to compositions</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%e a(30) = 24 because we have [16, 9, 4, 1] (24 permutations).

%p b:= proc(n, i, p) option remember; `if`(n=0, irem(1+p, 2)*p!,

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

%p end:

%p a:= n-> b(n, 1, 0):

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Dec 04 2020

%t b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[1 + p, 2]*p!,

%t With[{s = i^2}, If[s > n, 0, b[n, i + 1, p] +

%t b[n - s, i + 1, p + 1]]]];

%t a[n_] := b[n, 1, 0];

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

%Y Cf. A000290, A331844, A332305, A339366, A339418, A339431.

%K nonn,look

%O 0,6

%A _Ilya Gutkovskiy_, Dec 04 2020

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 March 29 04:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)