The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A103381 Numbers which are the sum of four distinct squares, a^2+b^2+c^2+d^2, such that a^2+b^2, c^2+d^2, a^2+d^2 and b^2+c^2 are all prime. 3

%I #10 Jul 22 2018 11:45:06

%S 46,66,78,102,114,126,142,154,162,174,198,222,246,262,270,274,282,286,

%T 294,298,318,322,334,342,354,366,378,382,394,402,406,414,426,438,442,

%U 454,462,486,498,502,510,518,522,526,534,538,546,550,558,562,574,582

%N Numbers which are the sum of four distinct squares, a^2+b^2+c^2+d^2, such that a^2+b^2, c^2+d^2, a^2+d^2 and b^2+c^2 are all prime.

%C Such primes must be == 1 mod 4. All the terms of the sequence are of the form 4*k+2.

%e 46 = 1^2+2^2+5^2+4^2 = 5+41 = 17+29

%e 102 = 3^2+2^2+5^2+8^2 = 13+89 = 73+29

%t t = Partition[ Flatten[ Table[{a^2 + b^2 + c^2 + d^2, a^2, b^2, c^2, d^2}, {d, 4, 20}, {c, 3, d - 1}, {b, 2, c - 1}, {a, b - 1}]], 5]; lst = {}; lg = Length[t]; Do[a = t[[n, 2]]; b = t[[n, 3]]; c = t[[n, 4]]; d = t[[n, 5]]; If[ Drop[ Sort[ Join[ {Mod[a + b, 4] == 1 && Mod[c + d, 4] == 1 && PrimeQ[a + b] && PrimeQ[c + d]}, {Mod[a + c, 4] == 1 && Mod[b + d, 4] == 1 && PrimeQ[a + c] && PrimeQ[b + d]}, {Mod[a + d, 4] == 1 && Mod[b + c, 4] == 1 && PrimeQ[a + d] && PrimeQ[b + c]}]], 1] == {True, True}, AppendTo[ lst, t[[n, 1]] ]], {n, lg}]; Take[ Union[ lst], 52] (* _Robert G. Wilson v_, Mar 25 2005 *)

%t apQ[{a_,b_,c_,d_}]:=AllTrue[{a+b,c+d,a+d,b+c},PrimeQ]; Total/@Select[ Flatten[ Permutations/@Subsets[Range[20]^2,{4}],1],apQ]//Union (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jul 22 2018 *)

%K nonn

%O 1,1

%A _Robin Garcia_, Mar 20 2005

%E Edited by _Don Reble_ and _Robert G. Wilson v_, Mar 25 2005

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.

Last modified June 17 03:50 EDT 2024. Contains 373432 sequences. (Running on oeis4.)