A216828 Numbers whose squares can be written in all the four forms a^2 + b^2, a^2 + 2*b^2, a^2 + 3*b^2 and a^2 + 7*b^2, with a > 0 and b > 0.
60, 68, 110, 111, 120, 136, 143, 156, 164, 174, 180, 193, 204, 215, 220, 222, 226, 240, 272, 274, 286, 292, 300, 312, 318, 327, 328, 330, 333, 335, 337, 340, 348, 356, 360, 374, 380, 385, 386, 388, 407, 408, 420, 429, 430, 440, 444, 452, 457, 466, 468, 476, 480, 492, 522, 540, 544, 548, 550, 551, 555, 559, 562, 572, 579, 584
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
filter:= proc(n) local L,x,y; select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+y^2)]) <> [] and select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+2*y^2)]) <> [] and select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+3*y^2)]) <> [] and select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+7*y^2)]) <> [] end proc: select(filter, [$1..1000]); # Robert Israel, May 03 2018
-
Mathematica
okQ[n_] := Module[{x, y}, AllTrue[{1, 2, 3, 7}, Solve[x > 0 && y > 0 && n^2 == x^2 + #*y^2, {x, y}, Integers] =!= {}&]]; Select[Range[1000], okQ] (* Jean-François Alcover, May 23 2023 *)
Comments