L1[n_] := Select[Union@@Outer[Plus, ((Range[n])^2),((Range[n])^2)], PrimeQ]

Mod[L1[10],4]

L2[n_] := Select[Union@@Outer[Plus, ((Range[4n])^2),16((Range[n])^2)], PrimeQ]

L2[10]

Mod[L2[10],8]

137-16

L3[n_] := Select[Union@@Outer[(4((#1)^2)+4#1 #2+5 ((#2)^2))&, Range[n],Range[n]], PrimeQ]

L3[30]

Mod[L3[30],6]