login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A025367 Numbers that are the sum of 4 nonzero squares in 2 or more ways. 8

%I #21 Aug 05 2021 07:27:07

%S 28,31,34,36,37,39,42,43,45,47,49,50,52,54,55,57,58,60,61,63,66,67,68,

%T 69,70,71,73,74,75,76,77,78,79,81,82,83,84,85,86,87,90,91,92,93,94,95,

%U 97,98,99,100,102,103,105,106,107,108,109,110,111,112,113,114,115,116,117,118

%N Numbers that are the sum of 4 nonzero squares in 2 or more ways.

%H Robert Israel, <a href="/A025367/b025367.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%F {n: A025428(n) >= 2}. - _R. J. Mathar_, Jun 15 2018

%p N:= 1000: # to get all terms <= N

%p V:= Vector(N):

%p for x from 1 while x^2 +3 <= N do

%p for y from 1 to x while x^2 + y^2 + 2 <= N do

%p for z from 1 to y while x^2 + y^2 + z^2 + 1 <= N do

%p for w from 1 to z while x^2 + y^2 + z^2 + w^2 <= N do

%p t:= x^2 + y^2 + z^2 + w^2;

%p V[t]:= V[t]+1;

%p od od od od:

%p select(t -> V[t] >= 2, [$1..N]); # _Robert Israel_, Jul 05 2017

%t Select[Range@ 200, 2 == Length@ Quiet@ IntegerPartitions[#, {4}, Range[Sqrt@ #]^2, 2] &] (* _Giovanni Resta_, Jul 05 2017 *)

%t M = 1000;

%t Clear[V]; V[_] = 0;

%t For[a = 1, a <= Floor[Sqrt[M/4]], a++,

%t For[b = a, b <= Floor[Sqrt[(M - a^2)/3]], b++,

%t For[c = b, c <= Floor[Sqrt[(M - a^2 - b^2)/2]], c++,

%t For[d = c, d <= Floor[Sqrt[M - a^2 - b^2 - c^2]], d++,

%t m = a^2 + b^2 + c^2 + d^2;

%t V[m] = V[m] + 1;

%t ]]]];

%t Select[Range[M], V[#] >= 2&] (* _Jean-François Alcover_, Mar 22 2019, after _Robert Israel_ *)

%Y Cf. A000414, A024796, A025358, A025368, A025406, A344795.

%K nonn

%O 1,1

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 04:02 EDT 2024. Contains 371918 sequences. (Running on oeis4.)