cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A004432 Numbers that are the sum of 3 distinct nonzero squares.

Original entry on oeis.org

14, 21, 26, 29, 30, 35, 38, 41, 42, 45, 46, 49, 50, 53, 54, 56, 59, 61, 62, 65, 66, 69, 70, 74, 75, 77, 78, 81, 83, 84, 86, 89, 90, 91, 93, 94, 98, 101, 104, 105, 106, 107, 109, 110, 113, 114, 115, 116, 117, 118, 120, 121, 122, 125, 126, 129, 131, 133
Offset: 1

Views

Author

Keywords

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

Examples

			14 = 1^2 + 2^2 + 3^2;
62 = 1^2 + 5^2 + 6^2.
		

Crossrefs

Programs

  • 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
  • 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 *)
  • 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
    

Formula

A004432 = { x^2 + y^2 + z^2; 0 < x < y < z }.
n is in A004432 <=> A025442(n) > 0. - M. F. Hasler, Feb 03 2013