A025358 Numbers that are the sum of 4 nonzero squares in exactly 2 ways.
31, 34, 36, 37, 39, 43, 45, 47, 49, 50, 54, 57, 61, 68, 69, 71, 74, 77, 81, 83, 86, 94, 107, 113, 116, 131, 136, 144, 149, 200, 216, 272, 296, 344, 376, 464, 544, 576, 800, 864, 1088, 1184, 1376, 1504, 1856, 2176, 2304, 3200, 3456, 4352, 4736, 5504, 6016, 7424
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..77 (first 71 terms from Robert Price)
- Eric Weisstein's World of Mathematics, Square Number
- Index entries for sequences related to sums of squares
Crossrefs
Cf. A025367 (at least 2 ways).
Programs
-
Maple
N:= 10000: # to get all terms <= N T:= Vector(N): for a from 1 to floor(sqrt(N/4)) do for b from a to floor(sqrt((N-a^2)/3)) do for c from b to floor(sqrt((N-a^2-b^2)/2)) do for d from c to floor(sqrt(N-a^2-b^2-c^2)) do m:= a^2+b^2+c^2+d^2; T[m]:= T[m]+1; od od od od: select(i -> T[i] = 2, [$1..N]); # Robert Israel, Nov 03 2017
-
Mathematica
M = 1000; Clear[T]; T[_] = 0; For[a = 1, a <= Floor[Sqrt[M/4]], a++, For[b = a, b <= Floor[Sqrt[(M - a^2)/3]], b++, For[c = b, c <= Floor[Sqrt[(M - a^2 - b^2)/2]], c++, For[d = c, d <= Floor[Sqrt[M - a^2 - b^2 - c^2]], d++, m = a^2 + b^2 + c^2 + d^2; T[m] = T[m] + 1; ]]]]; Select[Range[M], T[#] == 2&] (* Jean-François Alcover, Mar 22 2019, after Robert Israel *)
Formula
{n: A025428(n) = 2}. - R. J. Mathar, Jun 15 2018
Comments