login
Number of partitions of n^2 into a square number of square parts.
1

%I #13 Jun 25 2022 12:54:03

%S 1,1,2,2,3,5,10,16,30,65,126,248,527,1024,2061,4310,8213,16367,33041,

%T 63217,122919,242242,458198,877519,1685444,3159685,5944954,11204470,

%U 20745676,38471990,71245358,130408025,238462989,435146790,787184098,1421400530,2559536132

%N Number of partitions of n^2 into a square number of square parts.

%H Alois P. Heinz, <a href="/A344708/b344708.txt">Table of n, a(n) for n = 0..100</a>

%e a(5) = 5: [25], [16,4,4,1], [9,9,1,1,1,1,1,1,1], [4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1].

%p s:= n-> issqr(n):

%p h:= proc(n) option remember; `if`(s(n), n, h(n-1)) end:

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

%p s(c+n), 1, 0), b(n-i, h(min(n-i, i)), c+1)+b(n, h(i-1), c))

%p end:

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

%p seq(a(n), n=0..40);

%t s[n_] := IntegerQ@Sqrt[n];

%t h[n_] := h[n] = If[s[n], n, h[n - 1]];

%t b[n_, i_, c_] := b[n, i, c] = If[n == 0 || i == 1, If[s[c + n], 1, 0],

%t b[n - i, h[Min[n - i, i]], c + 1] + b[n, h[i - 1], c]];

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

%t Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Jun 25 2022, after _Alois P. Heinz_ *)

%Y Cf. A000290.

%K nonn

%O 0,3

%A _Alois P. Heinz_, May 26 2021