|
|
A331996
|
|
Number of Pythagorean triples mod n: total number of solutions (x,y,z) to x^2 + y^2 = z^2 mod n with x <= y.
|
|
0
|
|
|
1, 3, 5, 14, 13, 19, 31, 52, 54, 51, 61, 110, 85, 111, 113, 232, 161, 207, 181, 302, 227, 243, 287, 436, 375, 339, 450, 614, 421, 451, 511, 912, 545, 611, 619, 1206, 685, 723, 761, 1204, 881, 895, 925, 1454, 1242, 1103, 1151, 2024, 1414, 1475, 1317, 2030, 1405
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Based on A062775, but that sequence counts (x,y,z) and (y,x,z) as different pairs.
|
|
LINKS
|
|
|
EXAMPLE
|
Below is an example for n = 3 (a(3) = 5).
(0 0 0)
(1 0 1)
(1 0 2)
(2 0 1)
(2 0 2)
In contrast, A062775, counts (1 0 1) and (0 1 1), etc. as different pairs and therefore A062775(3) = 9 .
|
|
MATHEMATICA
|
a[n_] := Block[{q = Association[(#[[1]] -> #[[2]]) & /@ Tally[ Mod[ Range[ n]^2, n]]]}, Sum[ Lookup[q, Mod[x^2 + y^2, n], 0], {x, n}, {y, x}]]; Array[a, 53] (* Giovanni Resta, Feb 04 2020 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|