A025429 Number of partitions of n into 5 nonzero squares.
0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 0, 1, 3, 1, 3, 2, 1, 3, 2, 1, 3, 3, 2, 3, 2, 2, 2, 2, 3, 3, 5, 2, 2, 5, 1, 3, 5, 1, 5, 4, 2, 5, 3, 2, 5, 5, 3, 4, 4, 4, 3, 5, 4, 4, 7, 3, 5, 6, 2, 4, 7, 4, 7, 6, 3, 7, 4, 3, 8, 6, 5, 7, 5, 5, 4, 6, 7, 6, 9, 5, 6, 8, 2, 8
Offset: 0
Links
- M. F. Hasler, Table of n, a(n) for n = 0..10000
- H. v. Eitzen, in reply to user James47, What is the largest integer with only one representation as a sum of five nonzero squares? on Mathematics Stack Exchange, May 2014
- Index entries for sequences related to sums of squares
Crossrefs
Column k=5 of A243148.
Programs
-
Maple
b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+ `if`(i^2>n, 0, b(n-i^2, i, t-1)))) end: a:= n-> b(n, isqrt(n), 5): seq(a(n), n=0..120); # Alois P. Heinz, May 30 2014
-
Mathematica
f[n_] := Block[{c = Range@ Sqrt@ n^2}, Length@ IntegerPartitions[n, {5}, c]]; Array[f, 105, 0] (* Robert G. Wilson v, May 30 2014 *) b[n_, i_, t_] := b[n, i, t] = If[n==0, If[t==0, 1, 0], If[i<1 || t<1, 0, b[n, i-1, t] + If[i^2>n, 0, b[n-i^2, i, t-1]]]]; a[n_] := b[n, Sqrt[n] // Floor, 5]; Table[a[n], {n, 0, 120}] (* Jean-François Alcover, Oct 12 2015, after Alois P. Heinz *)
-
PARI
A025429(n)=sum(d=sqrtint(max(n, 5)\5), sqrtint(max(n-4, 0)), nn=n-d^2; sum(a=sqrtint(max(nn-d^2, 4)\4), min(sqrtint(max(nn-3, 0)),d), sum(b=sqrtint((nn-a^2)\3-1)+1, min(sqrtint(nn-a^2-2), a), sum(c=sqrtint((t=nn-a^2-b^2)\2-1)+1, min(sqrtint(t-1), b), issquare(t-c^2) )))) \\ M. F. Hasler, May 30 2014
Formula
a(n) = [x^n y^5] Product_{k>=1} 1/(1 - y*x^(k^2)). - Ilya Gutkovskiy, Apr 19 2019
Comments