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

%I #14 Apr 09 2020 22:06:01

%S 1,3,5,14,13,19,31,52,54,51,61,110,85,111,113,232,161,207,181,302,227,

%T 243,287,436,375,339,450,614,421,451,511,912,545,611,619,1206,685,723,

%U 761,1204,881,895,925,1454,1242,1103,1151,2024,1414,1475,1317,2030,1405

%N 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.

%C Based on A062775, but that sequence counts (x,y,z) and (y,x,z) as different pairs.

%e Below is an example for n = 3 (a(3) = 5).

%e (0 0 0)

%e (1 0 1)

%e (1 0 2)

%e (2 0 1)

%e (2 0 2)

%e In contrast, A062775, counts (1 0 1) and (0 1 1), etc. as different pairs and therefore A062775(3) = 9 .

%t 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 *)

%Y Cf. A062775.

%K nonn

%O 1,2

%A _Yinxi Pan_, Feb 03 2020

%E More terms from _Giovanni Resta_, Feb 04 2020

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 May 2 14:44 EDT 2024. Contains 372197 sequences. (Running on oeis4.)