login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
Cf. A062775.
Sequence in context: A028942 A278314 A289622 * A179213 A074378 A185301
KEYWORD
nonn
AUTHOR
Yinxi Pan, Feb 03 2020
EXTENSIONS
More terms from Giovanni Resta, Feb 04 2020
STATUS
approved

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)