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!)
A331884 Number of compositions (ordered partitions) of n^2 into distinct squares. 3

%I #14 Nov 08 2020 04:27:28

%S 1,1,1,1,1,3,1,7,1,31,123,151,121,897,7351,5415,14881,48705,150583,

%T 468973,1013163,1432471,1730023,50432107,14925241,125269841,74592537,

%U 241763479,213156871,895153173,7716880623,2681163865,3190865761,22501985413,116279718801

%N Number of compositions (ordered partitions) of n^2 into distinct squares.

%H Alois P. Heinz, <a href="/A331884/b331884.txt">Table of n, a(n) for n = 0..300</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>

%F a(n) = A331844(A000290(n)).

%e a(5) = 3 because we have [25], [16, 9] and [9, 16].

%p b:= proc(n, i, p) option remember;

%p `if`(i*(i+1)*(2*i+1)/6<n, 0, `if`(n=0, p!,

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

%p end:

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

%p seq(a(n), n=0..35); # _Alois P. Heinz_, Jan 30 2020

%t b[n_, i_, p_] := b[n, i, p] = If[i(i+1)(2i+1)/6 < n, 0, If[n == 0, p!, If[i^2 > n, 0, b[n - i^2, i - 1, p + 1]] + b[n, i - 1, p]]];

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

%t a /@ Range[0, 35] (* _Jean-François Alcover_, Nov 08 2020, after _Alois P. Heinz_ *)

%Y Cf. A000290, A006456, A030273, A032020, A037444, A105152, A224366, A232173, A280129, A298640, A331844.

%K nonn

%O 0,6

%A _Ilya Gutkovskiy_, Jan 30 2020

%E a(24)-a(34) from _Alois P. Heinz_, Jan 30 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 April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)