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.

Showing 1-10 of 10 results.

A186434 Number of isosceles triangles that can be formed from the n^2 points of n X n grid of points (or geoboard).

Original entry on oeis.org

0, 4, 36, 148, 444, 1064, 2200, 4024, 6976, 11284, 17396, 25620, 36812, 51216, 69672, 92656, 121392, 156092, 198364, 248292, 307988, 377816, 459072, 552216, 660704, 784076, 924340, 1082228, 1261132, 1460408, 1684464, 1931800, 2208368
Offset: 1

Views

Author

Martin Renner, Apr 10 2011, Apr 13 2011

Keywords

Comments

This counts triples of distinct points A,B,C such that A,B,C are the vertices of an isosceles triangle with nonzero area. It would be nice to have a formula. - N. J. A. Sloane, Apr 22 2016
Place all bounding boxes of A279413 that will fit into the n X n grid in all possible positions, and the proper rectangles in two orientations: a(n) = Sum_{i=1..n} Sum_{j=1..i} k * (n-i+1) * (n-j+1) * A279413(i,j) where k=1 when i=j and k=2 otherwise. - Lars Blomberg, Feb 20 2017

Crossrefs

Programs

  • Maple
    with(linalg):
    IsTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if evalf(norm(a,2)+norm(b,2))>evalf(norm(c,2)) and evalf(norm(a,2)+norm(c,2))>evalf(norm(b,2)) and evalf(norm(b,2)+norm(c,2))>evalf(norm(a,2)) then true: else false: fi: end:
    IsIsoscelesTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if IsTriangle(points) then if norm(a,2)=norm(b,2) or norm(a,2)=norm(c,2) or norm(b,2)=norm(c,2) then true: else false: fi: else false: fi; end:
    a:=proc(n) local P,TriangleSet,i,j,a,b,c; P:=[]: for i from 0 to n do for j from 0 to n do P:=[op(P),[i,j]]: od; od; TriangleSet:={}: for a from 1 to nops(P) do for b from a+1 to nops(P) do for c from b+1 to nops(P) do if IsIsoscelesTriangle([P[a],P[b],P[c]]) then TriangleSet:={op(TriangleSet),[P[a],P[b],P[c]]}; fi; od; od; od; return(nops(TriangleSet)): end:

Extensions

a(10)-a(33) from Nathaniel Johnston, Apr 25 2011

A187452 Number of right isosceles triangles that can be formed from the n^2 points of n X n grid of points (or geoboard).

Original entry on oeis.org

0, 4, 28, 96, 244, 516, 968, 1664, 2680, 4100, 6020, 8544, 11788, 15876, 20944, 27136, 34608, 43524, 54060, 66400, 80740, 97284, 116248, 137856, 162344, 189956, 220948, 255584, 294140, 336900, 384160, 436224, 493408, 556036, 624444, 698976, 779988, 867844
Offset: 1

Views

Author

Martin Renner, Apr 10 2011, Apr 13 2011

Keywords

Comments

This counts triples of distinct points A,B,C such that A,B,C are the vertices of an isosceles triangle with nonzero area, where the angle at B is a right angle. The triangles can have any orientation.

Examples

			For n=2 if the four points are labeled
ab
cd
then the triangles are abc, abd, acd, bcd,
so a(2)=4.
For n=3, label the points
abc
def
ghi
The triangles are: abd (4*4 ways), acg (4 ways), ace and dbf (4 ways each), for a total of a(3) = 28. - _N. J. A. Sloane_, Jun 30 2016
		

Crossrefs

Programs

  • Maple
    with(linalg):
    IsTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if evalf(norm(a,2)+norm(b,2))>evalf(norm(c,2)) and evalf(norm(a,2)+norm(c,2))>evalf(norm(b,2)) and evalf(norm(b,2)+norm(c,2))>evalf(norm(a,2)) then true: else false: fi: end:
    IsRectangularTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if IsTriangle(points) then if dotprod(a,b)=0 or dotprod(a,c)=0 or dotprod(b,c)=0 then true: else false: fi: else false: fi; end:
    IsIsoscelesTriangle:=proc(points) local a,b,c; a:=points[3]-points[2]: b:=points[3]-points[1]: c:=points[2]-points[1]: if IsTriangle(points) then if norm(a,2)=norm(b,2) or norm(a,2)=norm(c,2) or norm(b,2)=norm(c,2) then true: else false: fi: else false: fi; end:
    IsRectangularIsoscelesTriangle:=proc(points) if IsRectangularTriangle(points) and IsIsoscelesTriangle(points) then true: else false: fi: end:
    a:=proc(n) local P,TriangleSet,i,j,a,b,c; P:=[]: for i from 0 to n do for j from 0 to n do P:=[op(P),[i,j]]: od; od; TriangleSet:={}: for a from 1 to nops(P) do for b from a+1 to nops(P) do for c from b+1 to nops(P) do if IsRectangularIsoscelesTriangle([P[a],P[b],P[c]]) then TriangleSet:={op(TriangleSet),[P[a],P[b],P[c]]}; fi; od; od; od; return(nops(TriangleSet)): end:
  • Mathematica
    LinearRecurrence[{4,-5,0,5,-4,1},{0,4,28,96,244,516},40] (* Harvey P. Dale, Apr 29 2016 *)
  • PARI
    concat(0, Vec(4*x^2*(1+3*x+x^2)/((1-x)^5*(1+x)) + O(x^50))) \\ Colin Barker, Apr 25 2016

Formula

Empirical: a(n)=4*a(n-1)-5*a(n-2)+5*a(n-4)-4*a(n-5)+a(n-6). [R. H. Hardin, Apr 30 2011]
Empirical g.f.: 4*x*(x^2+3*x+1)/((1+x)*(1-x)^5). - N. J. A. Sloane, Apr 12 2016
Both the recurrence and the g.f. are true. For proof see [Paper in preparation]. - Warren D. Smith, Apr 17 2016
From Colin Barker, Apr 25 2016: (Start)
a(n) = (3-3*(-1)^n-16*n^2+10*n^4)/24.
a(n) = (5*n^4-8*n^2)/12 for n even.
a(n) = (5*n^4-8*n^2+3)/12 for n odd.
(End)

Extensions

a(10) - a(36) from Nathaniel Johnston, Apr 25 2011

A279433 Triangle read by rows: T(n,k), n>=k>=1, is the number of right triangles with integral coordinates that have a bounding box of size n X k.

Original entry on oeis.org

0, 0, 4, 0, 6, 4, 0, 4, 12, 4, 0, 4, 6, 12, 12, 0, 4, 8, 12, 12, 4, 0, 4, 4, 6, 12, 20, 4, 0, 4, 4, 12, 12, 12, 20, 4, 0, 4, 4, 4, 14, 12, 20, 12, 12, 0, 4, 4, 4, 12, 12, 16, 12, 12, 20, 0, 4, 4, 8, 8, 6, 12, 20, 20, 20, 4, 0, 4, 4, 4, 4, 12, 28, 12, 12, 12
Offset: 1

Views

Author

Lars Blomberg, Feb 27 2017

Keywords

Examples

			Triangle begins:
0
0,4
0,6,4
0,4,12,4
0,4,6,12,12
0,4,8,12,12,4
0,4,4,6,12,20,4
0,4,4,12,12,12,20,4
0,4,4,4,14,12,20,12,12
0,4,4,4,12,12,16,12,12,20
0,4,4,8,8,6,12,20,20,20,4
0,4,4,4,4,12,28,12,12,12,20,4
0,4,4,4,4,12,6,20,20,16,20,20,12
0,4,4,4,12,4,24,12,12,12,20,12,20,4
0,4,4,4,4,4,12,6,28,20,12,20,20,20,4
0,4,4,4,4,4,8,12,20,20,12,20,12,20,28,4
0,4,4,4,4,12,4,12,18,12,20,12,28,12,20,20,28
-----
The right angle is 'o'.
For n=2, k=2:
ox   xo   x.   .x
x.   .x   ox   xo
So T(2,2)=4
-----
For n=3, k=2:
o.x   x.x   x.o   x..   .o.   ..x
x..   .o.   ..x   o.x   x.x   x.o
So T(3,2)=6
		

Crossrefs

Cf. A077435.
See A279415 for right isosceles triangles.
See A280639 for obtuse isosceles triangles.
See A279418 for acute isosceles triangles.
See A279413 for all isosceles triangles.
See A280652 for all obtuse triangles.
See A280653 for all acute triangles.
See A279432 for all triangles.

A189814 T(n,k)=Number of right triangles on a (n+1)X(k+1) grid.

Original entry on oeis.org

4, 14, 14, 28, 44, 28, 46, 94, 94, 46, 68, 158, 200, 158, 68, 94, 238, 342, 342, 238, 94, 124, 330, 524, 596, 524, 330, 124, 158, 434, 732, 926, 926, 732, 434, 158, 196, 550, 972, 1308, 1444, 1308, 972, 550, 196, 238, 678, 1236, 1754, 2060, 2060, 1754, 1236, 678
Offset: 1

Views

Author

R. H. Hardin Apr 28 2011

Keywords

Comments

Table starts
...4..14...28...46...68...94...124...158...196...238...284...334...388...446
..14..44...94..158..238..330...434...550...678...818...970..1134..1310..1498
..28..94..200..342..524..732...972..1236..1524..1840..2180..2544..2932..3344
..46.158..342..596..926.1308..1754..2250..2794..3390..4026..4702..5426..6190
..68.238..524..926.1444.2060..2784..3596..4492..5470..6516..7630..8820.10070
..94.330..732.1308.2060.2960..4032..5250..6604..8082..9684.11388.13220.15144
.124.434..972.1754.2784.4032..5520..7224..9128.11218.13500.15938.18568.21328
.158.550.1236.2250.3596.5250..7224..9496.12044.14860.17948.21266.24852.28634
.196.678.1524.2794.4492.6604..9128.12044.15332.18990.23012.27354.32052.37032
.238.818.1840.3390.5470.8082.11218.14860.18990.23596.28678.34190.40166.46522

Examples

			Some solutions for n=3 k=3
..2..3....2..1....0..2....0..1....3..1....1..3....4..2....2..2....1..1....3..2
..1..2....0..3....0..3....0..2....1..3....1..2....2..1....2..1....0..2....1..3
..4..1....3..2....4..2....5..1....5..3....4..3....5..0....5..2....2..2....2..0
		

Crossrefs

Column 1 is -A147973(n+4)
Diagonal is A077435(n+1)

Formula

Empirical for columns
k=1: a(n) = 2*n^2 + 4*n - 2
k=2: a(n) = 6*n^2 + 26*n - 42 for n>3
k=3: a(n) = 12*n^2 + 88*n - 240 for n>8
k=4: a(n) = 20*n^2 + 228*n - 930 for n>15
k=5: a(n) = 30*n^2 + 468*n - 2478 for n>24
k=6: a(n) = 42*n^2 + 886*n - 6080 for n>35
k=7: a(n) = 56*n^2 + 1480*n - 12216 for n>48
k=8: a(n) = 72*n^2 + 2344*n - 23112 for n>63
k=9: a(n) = 90*n^2 + 3516*n - 40434 for n>80
k=10: a(n) = 110*n^2 + 5090*n - 67626 for n>99
k=11: a(n) = 132*n^2 + 7016*n - 105016 for n>120
k=12: a(n) = 156*n^2 + 9564*n - 162094 for n>143
k=13: a(n) = 182*n^2 + 12572*n - 236518 for n>168
k=14: a(n) = 210*n^2 + 16230*n - 337676 for n>195

A190019 Number of acute triangles on an n X n grid (or geoboard).

Original entry on oeis.org

0, 0, 8, 80, 404, 1392, 3880, 9208, 19536, 38096, 69288, 119224, 196036, 310008, 474336, 705328, 1023216, 1451904, 2020232, 2762848, 3719420, 4937200, 6469424, 8378184, 10734664, 13618168, 17119288, 21338760, 26390452, 32400592, 39508656, 47870200, 57655752
Offset: 1

Views

Author

Martin Renner, May 04 2011

Keywords

Comments

Place all bounding boxes of A280653 that will fit into the n X n grid in all possible positions, and the proper rectangles in two orientations: a(n) = Sum_{i=1..n} Sum_{j=1..i} k * (n-i+1) * (n-j+1) * A280653(i,j) where k=1 when i=j and k=2 otherwise. - Lars Blomberg, Feb 26 2017
According to Langford (p. 243), the leading order is (53/150-Pi/40)*C(n^2,3). See A093072. - Michael R Peake, Jan 15 2021

Crossrefs

Cf. A103429 (analogous problem on a 3-dimensional grid).

Formula

a(n) = A045996(n) - A077435(n) - A190020(n).

Extensions

Extended by Ray Chandler, May 04 2011
More terms from Lars Blomberg, Feb 26 2017

A190020 Number of obtuse triangles on an n X n grid (or geoboard).

Original entry on oeis.org

0, 0, 24, 236, 1148, 3932, 10760, 25392, 53576, 103824, 188104, 322852, 529116, 835028, 1275360, 1893496, 2742208, 3886568, 5402448, 7381316, 9928860, 13168484, 17243896, 22319864, 28579720, 36237928, 45532720, 56732668
Offset: 1

Views

Author

Martin Renner, May 04 2011

Keywords

Comments

Place all bounding boxes of A280652 that will fit into the n X n grid in all possible positions, and the proper rectangles in two orientations: a(n) = Sum_{i=1..n} Sum_{j=1..i} k * (n-i+1) * (n-j+1) * A280652(i,j) where k=1 when i=j and k=2 otherwise. - Lars Blomberg, Mar 02 2017
According to Langford (p. 243), the leading order is (97/150 + Pi/40)*C(n^2,3). See A093072. - Michael R Peake, Jan 15 2021

Crossrefs

Formula

a(n) = A045996(n) - A077435(n) - A190019(n).

Extensions

Extended by Ray Chandler, May 04 2011

A189979 Number of right triangles, distinct up to congruence, on an n X n grid (or geoboard).

Original entry on oeis.org

0, 1, 4, 9, 17, 26, 39, 53, 71, 91, 114, 136, 169, 197, 231, 267, 310, 346, 397, 437, 492, 548, 606, 654, 729, 791, 858, 928, 1007, 1071, 1173, 1241, 1333, 1423, 1509, 1600, 1728, 1814, 1912, 2015, 2144
Offset: 1

Views

Author

Martin Renner, May 03 2011

Keywords

Examples

			For n=3 the four right triangles are:
**.  *.*  *.*  .*.
*..  *..  ...  *..
...  ...  *..  .*.
		

Crossrefs

Programs

  • Maple
    Triangles:=proc(n) local TriangleSet,i,j,k,l,A,B,C; TriangleSet:={}: for i from 0 to n do for j from 0 to n do for k from 0 to n do for l from 0 to n do A:=i^2+j^2: B:=k^2+l^2: C:=(i-k)^2+(j-l)^2: if A^2+B^2+C^2<>2*(A*B+B*C+C*A) then TriangleSet:={op(TriangleSet),sort([sqrt(A),sqrt(B),sqrt(C)])}: fi: od: od: od: od: return(TriangleSet); end:
    IsRectangularTriangle:=proc(T) if T[1]^2+T[2]^2=T[3]^2 or T[1]^2+T[3]^2=T[2]^2 or T[2]^2+T[3]^2=T[1]^2 then true else false fi: end:
    a:=proc(n) local TriangleSet,RectangularTriangleSet,i; TriangleSet:=Triangles(n): RectangularTriangleSet:={}: for i from 1 to nops(TriangleSet) do if IsRectangularTriangle(TriangleSet[i]) then RectangularTriangleSet:={op(RectangularTriangleSet),TriangleSet[i]} fi: od: return(nops(RectangularTriangleSet)); end:

Extensions

a(21) through a(40) from Martin Renner, May 08 2011

A334581 Number of ways to choose 3 points that form an equilateral triangle from the A000292(n) points in a regular tetrahedral grid of side length n.

Original entry on oeis.org

0, 0, 4, 24, 84, 224, 516, 1068, 2016, 3528, 5832, 9256, 14208, 21180, 30728, 43488, 60192, 81660, 108828, 142764, 184708, 236088, 298476, 373652, 463524, 570228, 696012, 843312, 1014720, 1213096, 1441512, 1703352, 2002196, 2341848, 2726400, 3160272, 3648180
Offset: 0

Views

Author

Peter Kagey, May 06 2020

Keywords

Comments

a(n) >= 4 * A269747(n).
a(n) >= 4 * A000389(n+3) = A210569(n+2).
a(n) >= 4 * (n-1) + 4 * a(n-1) - 6 * a(n-2) + 4 * a(n-3) - a(n-4) for n >= 4.

Crossrefs

Cf. A000332 (equilateral triangles in triangular grid), A269747 (regular tetrahedra in a tetrahedral grid), A102698 (equilateral triangles in cube), A103158 (regular tetrahedra in cube).

A241225 Number of right triangles on a centered hexagonal grid of size n.

Original entry on oeis.org

0, 12, 216, 1104, 3708, 9396, 20304, 38868, 68364, 112632, 176076, 263832, 381924, 536424, 735240, 985896, 1296540, 1676508, 2137392, 2689248, 3344244, 4114020
Offset: 1

Views

Author

Martin Renner, Apr 17 2014

Keywords

Comments

A centered hexagonal grid of size n is a grid with A003215(n-1) points forming a hexagonal lattice.

Crossrefs

Cf. A077435.

Formula

a(n) = A241223(n) - A241224(n) - A241226(n).

Extensions

a(7) from Martin Renner, May 31 2014
a(8)-a(22) from Giovanni Resta, May 31 2014

A334881 Number of squares in 3-dimensional space whose four vertices have coordinates (x,y,z) in the set {1,...,n}.

Original entry on oeis.org

0, 0, 6, 54, 240, 810, 2274, 5304, 10752, 19992, 34854, 57774, 91200, 139338, 206394, 296832, 417120, 575556, 779238, 1037514, 1359792, 1760694, 2251362, 2845140, 3554976, 4404876, 5416278, 6605946, 7996896, 9621678, 11500962, 13667772, 16143552, 18973608, 22190406
Offset: 0

Views

Author

Peter Kagey, May 14 2020

Keywords

Comments

a(n) >= 3*n*A002415(n).

Examples

			For n = 5, one such square has vertex set {(2,1,1), (5,4,1), (4,5,5), (1,2,5)}.
		

Crossrefs

Cf. A002415 (squares in square grid), A098928 (cubes in cube grid).

Extensions

a(7)-a(12) from Pontus von Brömssen, May 15 2020
a(13)-a(20) from Peter Kagey, Jul 29 2020 via Mathematics Stack Exchange link
Terms a(21) and beyond from Zachary Kaplan, Sep 01 2020, via Mathematics Stack Exchange link
Showing 1-10 of 10 results.