A063468
Number of Pythagorean triples in the range [1..n], i.e., the number of integer solutions to x^2 + y^2 = z^2 with 1 <= x,y,z <= n.
Original entry on oeis.org
0, 0, 0, 0, 2, 2, 2, 2, 2, 4, 4, 4, 6, 6, 8, 8, 10, 10, 10, 12, 12, 12, 12, 12, 16, 18, 18, 18, 20, 22, 22, 22, 22, 24, 26, 26, 28, 28, 30, 32, 34, 34, 34, 34, 36, 36, 36, 36, 36, 40, 42, 44, 46, 46, 48, 48, 48, 50, 50, 52, 54, 54, 54, 54, 62, 62, 62, 64, 64, 66, 66, 66, 68, 70
Offset: 1
Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 27 2001
For n = 5 the Pythagorean triples are (3, 4, 5) and (4, 3, 5), so a (5) = 2.
For n = 10 the Pythagorean triples are (3, 4, 5), (4, 3, 5), (6, 8, 10) and (8, 6, 10), so a(10) = 4.
For n = 17 the Pythagorean triples are (3, 4, 5), (4, 5, 3), (5, 12, 13), (12, 5, 13), (6, 8, 10), (8, 6, 10), (8, 15, 17), (15, 8, 17), (9, 12, 15) and (12, 9, 15), so a(17) = 10.
a(n) = 2*partial sums of
A046080(n).
-
[#[: x in [1..n], y in [1..n]| IsSquare(x^2+y^2) and Floor(Sqrt(x^2+y^2)) le n]:n in [1..74]]; // Marius A. Burtea, Jan 22 2020
-
nq[n_] := SquaresR[2, n^2]/4 - 1; Accumulate@ Array[nq, 80] (* Giovanni Resta, Jan 23 2020 *)
A091143
Number of Pythagorean triples mod 2^n; i.e., number of solutions to x^2 + y^2 = z^2 mod 2^n.
Original entry on oeis.org
1, 4, 24, 96, 448, 1792, 7680, 30720, 126976, 507904, 2064384, 8257536, 33292288, 133169152, 534773760, 2139095040, 8573157376, 34292629504, 137304735744, 549218942976, 2197949513728, 8791798054912, 35175782154240, 140703128616960, 562881233944576
Offset: 0
Cf.
A062775 (number of Pythagorean triples mod n).
-
seq(op([(2^k-1)*2^(3*k-3),(2^k-1)*2^(3*k-1)]),k=1..30); # Robert Israel, Dec 03 2017
-
Table[n = 2^k; b = Table[0, {n}]; Do[ b[[1 + Mod[i^2, n]]]++, {i, 0, n - 1}]; cnt = 0; Do[m = x^2 + y^2; cnt = cnt + b[[1 + Mod[m, n]]], {x, 0, n - 1}, {y, 0, n - 1}]; cnt, {k, 0, 13}]
-
Vec(1/((4*x-1)*(8*x^2-1)) + O(x^100)) \\ Colin Barker, Oct 27 2013
A368197
Triangle read by rows: T(n,k) = Sum_{z=1..n} Sum_{y=1..n} Sum_{x=1..n} [GCD(f(x,y,z), n) = k], where f(x,y,z) = x^2 + y^2 - z^2.
Original entry on oeis.org
1, 4, 4, 18, 0, 9, 32, 8, 0, 24, 100, 0, 0, 0, 25, 72, 72, 36, 0, 0, 36, 294, 0, 0, 0, 0, 0, 49, 256, 64, 0, 96, 0, 0, 0, 96, 486, 0, 144, 0, 0, 0, 0, 0, 99, 400, 400, 0, 0, 100, 0, 0, 0, 0, 100, 1210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121
Offset: 1
Triangle begins:
1;
4, 4;
18, 0, 9;
32, 8, 0, 24;
100, 0, 0, 0, 25;
72, 72, 36, 0, 0, 36;
294, 0, 0, 0, 0, 0, 49;
256, 64, 0, 96, 0, 0, 0, 96;
486, 0, 144, 0, 0, 0, 0, 0, 99;
400, 400, 0, 0, 100, 0, 0, 0, 0, 100;
1210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121;
...
-
nn = 11; p = 2; f = x^p + y^p - z^p; Flatten[Table[Table[Sum[Sum[Sum[If[GCD[f, n] == k, 1, 0], {x, 1, n}], {y, 1, n}], {z, 1, n}], {k, 1, n}], {n, 1, nn}]]
A096020
Number of Pythagorean quintuples mod n; i.e., number of solutions to v^2 + w^2 + x^2 + y^2 = z^2 mod n.
Original entry on oeis.org
1, 16, 81, 192, 625, 1296, 2401, 3072, 6723, 10000, 14641, 15552, 28561, 38416, 50625, 47104, 83521, 107568, 130321, 120000, 194481, 234256, 279841, 248832, 393125, 456976, 544563, 460992, 707281, 810000, 923521, 753664
Offset: 1
x + 16 x^2 + 81 x^3 + 192 x^4 + 625 x^5 + 1296 x^6 + 2401 x^7 + ...
Cf.
A062775 (number of solutions to x^2 + y^2 = z^2 mod n),
A096018 (number of solutions to w^2 + x^2 + y^2 = z^2 mod n).
-
Table[cnt=0; Do[If[Mod[v^2+w^2+x^2+y^2-z^2, n]==0, cnt++ ], {v, 0, n-1}, {w, 0, n-1}, {x, 0, n-1}, {y, 0, n-1}, {z, 0, n-1}]; cnt, {n, 30}]
a[ n_] := If[ n < 1, 0, Sum[ 1 - Sign[ Mod[ v^2 + w^2 + x^2 + y^2 - z^2, n]], {v, n}, {w, n}, {x, n}, {y, n}, {z, n}]]; (* Michael Somos, Jan 21 2012 *)
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
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 .
-
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 *)
Comments