[go: up one dir, main page]

login
Search: a025376 -id:a025376
     Sort: relevance | references | number | modified | created      Format: long | short | data
Number of partitions of n into 4 distinct nonzero squares.
+10
32
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 3, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 1, 2, 2, 0, 0, 1, 2, 0, 0, 3, 0, 0, 2, 1, 1
OFFSET
0,79
FORMULA
a(n) = [x^n y^4] Product_{k>=1} (1 + y*x^(k^2)). - Ilya Gutkovskiy, Apr 22 2019
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
`if`(t*i^2<n, 0, `if`(i=1, 0, b(n, i-1, t))+
`if`(i^2>n, 0, b(n-i^2, i-1, t-1))))
end:
a:= n-> b(n, isqrt(n), 4):
seq(a(n), n=0..150); # Alois P. Heinz, Feb 07 2013
MATHEMATICA
b[n_, i_, t_] := b[n, i, t] = If[n==0, If[t==0, 1, 0], If[t*i^2<n, 0, If[i == 1, 0, b[n, i-1, t]] + If[i^2>n, 0, b[n-i^2, i-1, t-1]]]]; a[n_] := b[n, Sqrt[n] // Floor, 4]; Table[a[n], {n, 0, 150}] (* Jean-François Alcover, Feb 29 2016, after Alois P. Heinz*)
dnzs[n_]:=Length[Select[IntegerPartitions[n, {4}], Length[Union[#]]==4&&AllTrue[ Sqrt[ #], IntegerQ] && FreeQ[#, 0]&]]; Array[dnzs, 110, 0] (* Harvey P. Dale, Jun 09 2024 *)
CROSSREFS
Cf. A025428 (not necessarily distinct), A025376-A025394 (subsequences), A025417 (greedy inverse).
Column k=4 of A341040.
KEYWORD
nonn,look
STATUS
approved
Numbers that are the sum of 4 distinct nonzero squares: of form w^2+x^2+y^2+z^2 with 0<w<x<y<z.
+10
17
30, 39, 46, 50, 51, 54, 57, 62, 63, 65, 66, 70, 71, 74, 75, 78, 79, 81, 84, 85, 86, 87, 90, 91, 93, 94, 95, 98, 99, 102, 105, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 129, 130, 131, 133, 134, 135, 137
OFFSET
1,1
FORMULA
{n: A025443(n) >=1}. Union of A025386 and A025376. - R. J. Mathar, Jun 15 2018
EXAMPLE
30 = 1^2+2^2+3^2+4^2.
MATHEMATICA
data = Flatten[ DeleteCases[ FindInstance[ w^2 + x^2 + y^2 + z^2 == # && 0 < w < x < y < z < #, {w, x, y, z}, Integers] & /@ Range[137], {}], 1]; w^2 + x^2 + y^2 + z^2 /. data (* Ant King, Oct 17 2010 *)
Select[Union[Total[#^2]&/@Subsets[Range[10], {4}]], #<=137&] (* Harvey P. Dale, Jul 03 2011 *)
PROG
(Haskell)
a004433 n = a004433_list !! (n-1)
a004433_list = filter (p 4 $ tail a000290_list) [1..] where
p k (q:qs) m = k == 0 && m == 0 ||
q <= m && k >= 0 && (p (k - 1) qs (m - q) || p k qs m)
-- Reinhard Zumkeller, Apr 22 2013
(PARI) list(lim)=my(v=List()); lim\=1; for(z=4, sqrtint(lim\4), for(y=3, min(sqrtint((lim-z^2)\3), z-1), for(x=2, min(sqrtint((lim-y^2-z^2)\2), y-1), for(w=1, min(sqrtint(lim-x^2-y^2-z^2), x-1), listput(v, w^2+x^2+y^2+z^2))))); Set(v) \\ Charles R Greathouse IV, Feb 07 2017
KEYWORD
nonn,easy,nice
STATUS
approved
Numbers that are the sum of 4 distinct nonzero squares in 2 or more ways.
+10
2
78, 90, 94, 95, 99, 102, 105, 110, 111, 114, 119, 123, 126, 129, 130, 134, 135, 138, 141, 142, 143, 146, 147, 150, 151, 153, 154, 155, 156, 158, 159, 162, 165, 166, 167, 169, 170, 171, 174, 175, 177, 179, 182, 183, 185, 186, 189, 190, 191, 193, 194, 195, 197, 198, 199
OFFSET
1,1
FORMULA
{n: A025443(n) >= 2}. Union of A025387 and A025376. - R. J. Mathar, Jun 15 2018
KEYWORD
nonn
STATUS
approved

Search completed in 0.006 seconds