A224366 Number of compositions of n^2 into sums of squares.
1, 1, 2, 11, 124, 2870, 133462, 12477207, 2344649612, 885591183971, 672331353833716, 1025954712063362545, 3146790000180780110540, 19400015532276248131470280, 240398159948843792847457589388, 5987629866666297470033540284817068, 299759874416459708067727376075503706332
Offset: 0
Keywords
Examples
Illustrate a(n) = Sum_{k=1..n} A006456(n^2-k^2): a(1) = 1 = 1; a(2) = 2 = 1 + 1; a(3) = 11 = 7 + 3 + 1; a(4) = 124 = 88 + 30 + 5 + 1; a(5) = 2870 = 2024 + 710 + 124 + 11 + 1; a(6) = 133462 = 94137 + 33033 + 5767 + 502 + 22 + 1; a(7) = 12477207 = 8800750 + 3088365 + 539192 + 46832 + 2024 + 43 + 1; ...
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..81
Programs
-
Maple
b:= proc(n) option remember; local i; if n=0 then 1 else 0; for i while i^2<=n do %+b(n-i^2) od fi end: a:= n-> b(n^2): seq(a(n), n=0..17); # Alois P. Heinz, Aug 12 2017
-
Mathematica
b[0] = 1; b[n_] := b[n] = Sum[b[n-k], {k, Select[Range[n], IntegerQ[ Sqrt[#]]&]}]; a[n_] := b[n^2]; Table[a[n], {n, 0, 16}] (* Jean-François Alcover, Jun 09 2018 *)
-
PARI
{a(n)=polcoeff(1/(1-sum(k=1,n,x^(k^2))+x*O(x^(n^2))),n^2)} for(n=0,21,print1(a(n),", "))
-
PARI
{A006456(n)=polcoeff(1/(1-sum(k=1,sqrtint(n+1),x^(k^2))+x*O(x^n)),n)} {a(n)=if(n==0,1,sum(k=1,n,A006456(n^2-k^2)))} for(n=0,21,print1(a(n),", "))
Comments