A000328
Number of points of norm <= n^2 in square lattice.
Original entry on oeis.org
1, 5, 13, 29, 49, 81, 113, 149, 197, 253, 317, 377, 441, 529, 613, 709, 797, 901, 1009, 1129, 1257, 1373, 1517, 1653, 1793, 1961, 2121, 2289, 2453, 2629, 2821, 3001, 3209, 3409, 3625, 3853, 4053, 4293, 4513, 4777, 5025, 5261, 5525, 5789, 6077, 6361, 6625
Offset: 0
- J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
- H. Gupta, A Table of Values of N_3(t), Proc. National Institute of Sciences of India, 13 (1947), 35-63.
- C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 47.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- T. D. Noe and Robert Israel, Table of n, a(n) for n = 0..10000 (n=0..1000 from T. D. Noe)
- W. Fraser and C. C. Gotlieb, A calculation of the number of lattice points in the circle and sphere, Math. Comp., 16 (1962), 282-290.
- Eric Weisstein's World of Mathematics, Gauss's Circle Problem
- Jianqiang Zhao, The Largest Circle Enclosing n Lattice Points, arXiv:2505.06234 [math.GM], 2025. See Table 3 p. 18.
-
a000328 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n^2]
-- Reinhard Zumkeller, Jan 23 2012
-
Table[Sum[SquaresR[2, k], {k, 0, n^2}], {n, 0, 46}]
-
{ a(n) = 1 + 4 * sum(j=0,n^2\4, n^2\(4*j+1) - n^2\(4*j+3) ) } /* Max Alekseyev, Nov 18 2007 */
-
def A000328(n):
return (sum([int((n**2 - y**2)**0.5) for y in range(1, n)]) * 4 + 4*n + 1)
# Karl-Heinz Hofmann, Aug 03 2022
-
from math import isqrt
def A000328(n): return 1+(sum(isqrt(k*((n<<1)-k)) for k in range(1,n+1))<<2) # Chai Wah Wu, Feb 12 2025
A247587
Number of obtuse triangles with integer sides at most n.
Original entry on oeis.org
0, 0, 1, 2, 4, 8, 13, 20, 30, 42, 57, 74, 95, 120, 149, 182, 219, 261, 309, 362, 420, 485, 556, 632, 715, 806, 906, 1012, 1125, 1247, 1377, 1517, 1666, 1824, 1993, 2170, 2358, 2555, 2765, 2986
Offset: 1
a(4) = 2 because there are 2 obtuse triangles with integer sides less than or equal to 4: (2,2,3); (2,3,4).
-
tr_o:=proc(n) local a, b, c, t, d; t:=0:
for a to n do
for b from a to n do
for c from b to min(a+b-1, n) do
d:=a^2+b^2-c^2:
if d<0 then t:=t+1 fi
od od od;
[n, t]; end;
-
a(n)=sum(a=2,n-1,sum(b=a,n-1,max(0,min(n,a+b-1)-sqrtint(a^2+b^2)))) \\ Charles R Greathouse IV, Sep 20 2014
-
obtuse(n)=sum(a=2,n-1, max(0, sqrtint(n^2-1-a^2)-max(a,n-a+1)+1))
s=0; vector(100,n, s+=obtuse(n)) \\ Charles R Greathouse IV, Sep 20 2014
A236384
Number of non-congruent integer triangles with base length n whose apex lies on or within a space bounded by a semicircle of diameter n.
Original entry on oeis.org
0, 0, 1, 1, 3, 4, 5, 7, 10, 13, 15, 17, 22, 25, 30, 33, 38, 42, 48, 54, 58, 65, 71, 76, 85, 92, 100, 106, 114, 123, 130, 140, 149, 159, 170, 177, 189, 197, 211, 222, 231, 243, 255, 269, 282, 292, 306, 318, 333, 348, 364, 378, 391, 406, 420, 438, 453, 470, 485
Offset: 1
a(5)=3 as there are 3 non-congruent integer triangles with base length 5 whose apex lies on or within the space bounded by the semicircle of diameter 5. The integer triples are (2,4,5), (3,3,5), (3,4,5).
-
c = Slider(1, 20, 1);
L = Flatten(Sequence(Sequence(((a^2+c^2-(c-a+k)^2)/(2c),((a+(c-a+k)+c)(a+(c-a+k)-c)(a-(c-a+k)+c)(-a+(c-a+k)+c))^(1/2)/(2c)),a,k,(c+k)/2),k,1,c));
C = {Circle((c/2,0),c/2)};
a_n = CountIf(IsInRegion((x(A),y(A)),Element(C,1)),A,L);
# Frank M Jackson, Jan 01 2024
-
sumtriangles[c_] := (n=0; Do[If[a^2+b^2<=c^2, n++], {b, 1, c}, {a, c-b+1, b}]; n); Table[sumtriangles[m], {m, 1, 200}]
-
a(n)=sum(a=2,n,sum(b=max(a,n+1-a),n,a^2+b^2<=n^2)) \\ Charles R Greathouse IV, Mar 26 2014
-
a(n)=sum(a=2,n,max(min(sqrtint(n^2-a^2),n)-max(a,n+1-a)+1,0)) \\ Charles R Greathouse IV, Mar 26 2014
A247586
Number of acute triangles with integer sides less than or equal to n.
Original entry on oeis.org
1, 3, 6, 11, 17, 25, 36, 49, 64, 81, 102, 127, 154, 185, 219, 258, 301, 349, 401, 457, 520, 587, 660, 740, 824, 914, 1010, 1114, 1225, 1342, 1468, 1600, 1740, 1887, 2041, 2206, 2378, 2561, 2750, 2948
Offset: 1
a(2) = 3 because there are 3 acute triangles with integer sides less than or equal to 2: (1,1,1); (1,2,2); (2,2,2).
-
tr_a:=proc(n) local a,b,c,t,d;t:=0:
for a to n do
for b from a to n do
for c from b to min(a+b-1,n) do
d:=a^2+b^2-c^2:
if d>0 then t:=t+1 fi
od od od;
[n,t]; end;
-
a[n_] := Module[{a, b, c, d, t = 0}, Do[d = a^2 + b^2 - c^2; If[d>0, t++], {a, n}, {b, a, n}, {c, b, Min[a+b-1, n]}]; t]; Array[a, 40] (* Jean-François Alcover, Jun 19 2019, from Maple *)
-
import itertools
def A247586(n):
I = itertools.combinations_with_replacement(range(1,n+1),3)
F = filter(lambda c: c[0]**2 + c[1]**2 > c[2]**2, I)
return len(list(F))
print([A247586(n) for n in range(41)]) # Peter Luschny, Sep 22 2014
A255195
Triangle describing the shape of one eighth of the Gauss circle problem.
Original entry on oeis.org
1, 2, 0, 2, 1, 0, 2, 1, 1, 0, 2, 1, 2, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2, 1, 0, 0, 2, 1, 1, 2, 2, 0, 0, 0, 2, 1, 1, 2, 1, 2, 0, 0, 0, 2, 1, 1, 1, 2, 2, 1, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 1, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 2, 0, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 2, 1, 0, 0, 0, 0
Offset: 1
1,
2, 0,
2, 1, 0,
2, 1, 1, 0,
2, 1, 2, 0, 0,
2, 1, 1, 2, 0, 0,
2, 1, 1, 2, 1, 0, 0,
2, 1, 1, 2, 2, 0, 0, 0,
2, 1, 1, 2, 1, 2, 0, 0, 0,
2, 1, 1, 1, 2, 2, 1, 0, 0, 0,
2, 1, 1, 1, 2, 1, 2, 1, 0, 0, 0,
2, 1, 1, 1, 2, 1, 2, 2, 0, 0, 0, 0,
2, 1, 1, 1, 2, 1, 2, 2, 1, 0, 0, 0, 0
-
Flatten[Table[Sum[Table[If[And[If[n^2 + k^2 <= r^2, If[n >= k, 1, 0], 0] == 1, If[(n + 1)^2 + (k + 1)^2 <= r^2, If[n >= k, 1, 0], 0]== 0], 1, 0], {k, 0, r}], {n, 0, r}], {r, 0, 12}]]
A306673
a(n) is the number of distinct, non-similar acute triangles with integer sides and largest side <= n.
Original entry on oeis.org
1, 2, 4, 7, 12, 16, 26, 34, 46, 56, 76, 90, 116, 135, 161, 187, 229, 257, 308, 344, 394, 439, 511, 558, 636, 698, 779, 849, 959, 1027, 1152, 1245, 1362, 1465, 1603, 1703, 1874, 2004, 2164, 2298, 2507, 2639, 2867, 3034, 3235, 3421, 3690, 3866, 4147, 4354
Offset: 1
For n=4, there are 9 acute triangles with integer sides and largest side <= 4. These have sides {a,b,c} = {1, 1, 1}, {1, 2, 2}, {1, 3, 3}, {1, 4, 4}, {2, 2, 2}, {2, 2, 4}, {2, 3, 3}, {3, 3, 4}, {3, 4, 4}. But {2, 2, 2} is similar to {1,1,1} and {2,2,4} is similar to {1,1,2}, so these two triangles are excluded from the list and therefore a(4)=7.
-
#nType=1 for acute triangles, nType=2 for obtuse triangles, nType=0 for both triangles
CountTriangles := proc (n, nType := 1)
local aa, oo, a, b, c, tt, lAcute;
aa := {}; oo := {};
for a from n by -1 to 1 do for b from a by -1 to 1 do for c from b by -1 to 1 do
if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c and gcd(a, gcd(b, c)) = 1 then
lAcute := evalb(0 < b^2+c^2-a^2);
tt := sort([a, b, c]);
if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
end if
end do end do end do;
return sort(`if`(nType = 1, aa, `if`(nType=2,oo,`union`(aa,oo))))
end proc
-
Length@Select[DeleteDuplicates[Sort@# & /@ Tuples[Range@#, 3]], GCD @@ # == 1 && #[[1]] + #[[2]] > #[[3]] && #[[1]]^2 + #[[2]]^2 > #[[3]]^2 &] & /@ Range@50 (* Hans Rudolf Widmer, Dec 07 2023 *)
A247589
Number of integer-sided obtuse triangles with largest side n.
Original entry on oeis.org
0, 0, 1, 1, 2, 4, 5, 7, 10, 12, 15, 17, 21, 25, 29, 33, 37, 42, 48, 53, 58, 65, 71, 76, 83, 91, 100, 106, 113, 122, 130, 140, 149, 158, 169, 177, 188, 197, 210, 221, 230, 243, 255, 269, 281, 292, 306, 318, 333, 346
Offset: 1
a(5) = 2 because there are 2 integer-sided acute triangles with largest side 5: (2,4,5); (3,3,5).
-
tr_o:=proc(n) local a,b,t,d;t:=0:
for a to n do
for b from max(a,n+1-a) to n do
d:=a^2+b^2-n^2:
if d<0 then t:=t+1 fi
od od;
t; end;
A251607
Number of non-congruent integer triangles ABC with largest side BC of length n whose opposite vertex A lies inside the closed boundary formed by BC and a locus of points whose real distance from B is x, from C is y and x^3 + y^3 = n^3.
Original entry on oeis.org
0, 0, 1, 2, 3, 5, 8, 10, 14, 16, 20, 24, 29, 35, 39, 45, 51, 58, 66, 71, 80, 87, 97, 104, 115, 124, 133, 145, 154, 166, 178, 189, 202, 213, 228, 241, 254, 269, 283, 297, 315, 329, 346, 361, 380, 396, 413, 431, 450, 470, 487, 508, 528, 548, 569, 588, 613, 632, 655, 677, 701
Offset: 1
a(5)=3 as there are 3 non-congruent integer triangles with base length of 5 whose apex lies inside S(3). The integer triples are (3,3,5), (2,4,5), (3,4,5). The other triangles from the complete set of non-congruent integer triangles with longest side length 5 (A002620(5+1)) are (4,4,5), (1,5,5), (2,5,5), (3,5,5), (4,5,5), (5,5,5) and lie outside the closed boundary.
-
n = Slider(1, 20, 1);
L = Flatten(Sequence(Sequence(((a^2+n^2-(n-a+k)^2)/(2n),((a+(n-a+k)+n)(a+(n-a+k)-n)(a-(n-a+k)+n)(-a+(n-a+k)+n))^(1/2)/(2n)),a,k,(n+k)/2),k,1,n));
p = 3;
C = Curve((a^2+n^2-(n^p-a^p)^(2/p))/(2n),((a+(n^p-a^p)^(1/p)+n)(a+(n^p-a^p)^(1/p)-n)(a-(n^p-a^p)^(1/p)+n)(-a+(n^p-a^p)^(1/p)+n))^(1/2)/(2n),a,0,n);
a_n = CountIf((x(A)^2+y(A)^2)^(p/2)+((n-x(A))^2+y(A)^2)^(p/2)Frank M Jackson, Jan 02 2024
-
sumtriangles[c_] := (n = 0; Do[If[a^3+b^3c, n++], {b, 1, c}, {a, 1, b}]; n); Table[sumtriangles[m], {m, 1, 200}]
Showing 1-8 of 8 results.
Comments