login
A354620
Numbers k such that whenever the sum of three squares is divisible by k, at least two of the squares are congruent mod k.
0
1, 2, 3, 4, 6, 8, 9, 11, 12, 16, 24, 32, 33, 36, 44, 48, 64, 96, 128, 132, 144, 176, 192, 256, 384, 512, 528, 576, 704, 768, 1024, 1536, 2048, 2112, 2304, 2816, 3072, 4096, 6144, 8192, 8448, 9216, 11264, 12288, 16384, 24576, 32768, 33792, 36864, 45056, 49152, 65536, 98304, 131072, 135168, 147456
OFFSET
1,2
COMMENTS
If k is in the sequence and k = a*b with a and b coprime, then a and b are in the sequence. The converse is not true (thus 2 and 9 are in the sequence but 18 is not).
EXAMPLE
5 is not in the sequence because 0^2 + 1^2 + 2^2 = 5 is divisible by 5, with 0^2 = 0, 1^2 = 1 and 2^2 = 4 all distinct mod 5.
a(5) = 6 is in the sequence because the solutions to a^2 + b^2 + c^2 == 0 (mod 6) have (up to permutation) [a^2, b^2, c^2] == [0, 0, 0], [0, 3, 3], [1, 1, 4], or [4, 4, 4], all of which have at least two congruent mod 6.
MAPLE
filter:= proc(n) local R, i, j, nR, a, b, c;
R:= {seq(i^2 mod n, i=0..n-1)}:
nR:= nops(R);
for i from 2 to nR do
a:= R[i];
for j from 1 to i-1 do
b:= R[j];
c:= -a-b mod n;
if member(c, R) and c <> a and c <> b then return false fi;
od od;
true
end proc:
select(filter, [$1..100000]);
MATHEMATICA
filter[n_] := Module[{R, i, j, nR, a, b, c}, R = Union@ Table[Mod[i^2, n], {i, 0, n-1}]; nR = Length[R]; For[i = 2, i <= nR, i++, a = R[[i]]; For[j = 1, j <= i-1, j++, b = R[[j]]; c = Mod[-a-b, n]; If[MemberQ[R, c] && c != a && c != b, Return[False]]]]; True];
Select[Range[10000], filter] (* Jean-François Alcover, May 12 2023, after Robert Israel *)
CROSSREFS
Sequence in context: A282697 A002479 A010458 * A218980 A084829 A018649
KEYWORD
nonn
AUTHOR
Robert Israel, Jul 10 2022
STATUS
approved