OFFSET
1,1
COMMENTS
Numbers that can be written as a(n) = x^2 + y^2 + z^2 with 0 < x < y < z.
This is a subsequence (equal to the range) of A024803. As a set, it is the union of A025339 and A024804, subsequences of numbers having exactly one, resp. more than one, such representations. - M. F. Hasler, Jan 25 2013
Conjecture: a number n is a sum of 3 squares, but not a sum of 3 distinct nonzero squares (i.e., is in A004432 but not A000408), if and only if it is of the form 4^j*s, where j >= 0 and s in {1, 2, 3, 5, 6, 9, 10, 11, 13, 17, 18, 19, 22, 25, 27, 33, 34, 37, 43, 51, 57, 58, 67, 73, 82, 85, 97, 99, 102, 123, 130, 163, 177, 187, 193, 267, 627, 697}. - Jeffrey Shallit, Jan 15 2017
4*a(n) gives the sums of 3 distinct nonzero even squares. - Wesley Ivan Hurt, Apr 05 2021
LINKS
FORMULA
A004432 = { x^2 + y^2 + z^2; 0 < x < y < z }.
EXAMPLE
14 = 1^2 + 2^2 + 3^2;
62 = 1^2 + 5^2 + 6^2.
MATHEMATICA
f[upto_]:=Module[{max=Floor[Sqrt[upto]]}, Select[Union[Total/@ (Subsets[ Range[ max], {3}]^2)], #<=upto&]]; f[150] (* Harvey P. Dale, Mar 24 2011 *)
PROG
(PARI) is_A004432(n)=for(x=1, sqrtint(n\3), for(y=x+1, sqrtint((n-1-x^2)\2), issquare(n-x^2-y^2)&return(1))) \\ M. F. Hasler, Feb 02 2013
(Haskell)
a004432 n = a004432_list !! (n-1)
a004432_list = filter (p 3 $ 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
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved