cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Yinxi Pan

Yinxi Pan's wiki page.

Yinxi Pan has authored 1 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.

Original entry on oeis.org

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
Offset: 1

Author

Yinxi Pan, Feb 03 2020

Keywords

Comments

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

Examples

			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 .
		

Crossrefs

Cf. A062775.

Programs

  • 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 *)

Extensions

More terms from Giovanni Resta, Feb 04 2020