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 21 results. Next

A061144 Sum of the areas of triangles whose vertices lie on the n X n grid with unit spacing as enumerated in A045996.

Original entry on oeis.org

0, 2, 70, 764, 4718, 20658, 71616, 209752, 540416, 1259050, 2704494, 5433420, 10320054, 18688026, 32478032, 54460064, 88495536, 139857842, 215617062, 325102172, 480442174, 697204602, 995133456, 1399002496, 1939589056
Offset: 1

Views

Author

Zachary Franco, Apr 15 2001

Keywords

Examples

			a(2)=4*(1/2)=2 and a(3)=32*(1/2)+32*(1)+4*(3/2)+8*(2)=70.
		

Crossrefs

Cf. A045996.

Extensions

a(14)-a(25) and corrected offset from Nathaniel Johnston, Apr 29 2011

A000938 Number of collinear point-triples in an n X n grid.

Original entry on oeis.org

0, 0, 8, 44, 152, 372, 824, 1544, 2712, 4448, 6992, 10332, 15072, 21012, 28688, 38520, 50880, 65480, 83640, 104676, 130264, 160556, 195848, 235600, 282840, 336384, 397136, 465876, 544464, 630684, 729744, 837744, 958384, 1091904, 1238520, 1400140, 1581384, 1776084
Offset: 1

Views

Author

Keywords

Comments

This is related to the no-3-in-line problem on an n X n grid.

Examples

			a(3) = 8: the 3 rows, 3 columns and 2 diagonals of a 3 X 3 grid.
		

References

  • M. A. Adena, D. A. Holton and P. A. Kelly, Some thoughts on the no-three-in-line problem, pp. 6-17 of Combinatorial Mathematics (Proceedings 2nd Australian Conf.), Lect. Notes Math. 403, 1974.
  • R. K. Guy, Unsolved combinatorial problems, pp. 121-127 of D. J. A. Welsh, editor, Combinatorial Mathematics and Its Applications. Academic Press, NY, 1971.
  • R. K. Guy and P. A. Kelly, The No-Three-Line Problem. Research Paper 33, Department of Mathematics, Univ. of Calgary, Calgary, Alberta, 1968. Condensed version in Canad. Math. Bull. Vol. 11, pp. 527-531, 1968.
  • 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).

Crossrefs

This is the main diagonal of the array in A334704.
Cf. A157882 for the 3-D version.

Programs

  • Maple
    a:=n->2*sum(sum((n - k + 1)*(n - m + 1)*igcd(k - 1, m - 1), k= 2.. n), m= 2.. n) - n^2*(n^2 - 1)/6;
    seq(a(n),n=2..30); # Dennis P. Walsh, Mar 02 2013
  • Mathematica
    a[n_] := 2*Sum[(n - k + 1)*(n - m + 1)*GCD[k - 1, m - 1], {m, 2, n}, {k, 2, n}] - n^2*((n^2 - 1)/6); Table[a[n], {n, 2, 30}] (* Jean-François Alcover, Jul 11 2012, after Ignacio Larrosa Cañestro *)

Formula

a(n) = 2*Sum(Sum((n - k + 1)*(n - m + 1)*gcd(k - 1, m - 1), k, 2, n), m, 2, n) - n^2(n^2 - 1)/6. - Ignacio Larrosa Cañestro, May 23 2010
a(n) = binomial(n^2, 3) - A045996(n). - Ignacio Larrosa Cañestro, May 23 2010

Extensions

Terms a(11) through a(30) from John W. Layman, Sep 21 2000
Typo in formula corrected by David Bevan, Jan 09 2012
Offset changed to 1 and initial 0 added. - N. J. A. Sloane, Jun 19 2020

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

A088658 Number of triangles in an n X n unit grid that have minimal possible area (of 1/2).

Original entry on oeis.org

0, 4, 32, 124, 320, 716, 1328, 2340, 3792, 5852, 8544, 12260, 16864, 22916, 30272, 39188, 49824, 62948, 78080, 96348, 117232, 141260, 168480, 200292, 235680, 276100, 321056, 371484, 427024, 489900, 558112, 634724, 718432, 810116, 909600, 1018388, 1135136, 1263828, 1402304, 1551908
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Nov 21 2003

Keywords

Examples

			a(2)=4 because 4 (isosceles right) triangles with area 1/2 can be placed on a 2 X 2 grid.
		

Crossrefs

Cf. A045996.
The following eight sequences are all essentially the same. The simplest is A115004(n), which we denote by z(n). Then A088658(n) = 4*z(n-1); A114043(n) = 2*z(n-1)+2*n^2-2*n+1; A114146(n) = 2*A114043(n); A115005(n) = z(n-1)+n*(n-1); A141255(n) = 2*z(n-1)+2*n*(n-1); A290131(n) = z(n-1)+(n-1)^2; A306302(n) = z(n)+n^2+2*n. - N. J. A. Sloane, Feb 04 2020

Programs

  • Mathematica
    z[n_] := Sum[(n - i + 1)(n - j + 1) Boole[GCD[i, j] == 1], {i, n}, {j, n}];
    a[n_] := 4 z[n - 1];
    Array[a, 40] (* Jean-François Alcover, Mar 24 2020 *)
  • Python
    from sympy import totient
    def A088658(n): return 4*(n-1)**2 + 4*sum(totient(i)*(n-i)*(2*n-i) for i in range(2,n)) # Chai Wah Wu, Aug 15 2021

Formula

a(n+1) = 4*A115004(n).
a(n) = 4*(n-1)^2 + 4*Sum_{i=2..n-1} (n-i)*(2n-i)*phi(i). - Chai Wah Wu, Aug 15 2021

Extensions

a(7)-a(28) from Ray Chandler, May 03 2011
Corrected and extended by Ray Chandler, May 18 2011

A279437 Number of ways to place 3 points on an n X n square grid so that no more than 2 points are on a vertical or horizontal straight line.

Original entry on oeis.org

0, 4, 78, 528, 2200, 6900, 17934, 40768, 83808, 159300, 284350, 482064, 782808, 1225588, 1859550, 2745600, 3958144, 5586948, 7739118, 10541200, 14141400, 18711924, 24451438, 31587648, 40380000, 51122500, 64146654, 79824528, 98571928, 120851700, 147177150, 178115584
Offset: 1

Views

Author

Heinrich Ludwig, Dec 12 2016

Keywords

Comments

Column 4 of triangle A279445.
Rotations and reflections of placements are counted. For numbers if they are to be ignored see A279447.
For condition "no more than 2 points on straight lines at any angle", see A045996.

Crossrefs

Same problem but 2, 4..9 points: A083374, A279438, A279439, A279440, A279441, A279442, A279443.

Programs

  • Mathematica
    Table[(n^6 - 5 n^4 + 6 n^3 - 2 n^2)/6, {n, 32}] (* or *)
    Rest@ CoefficientList[Series[2 x^2*(2 + 25 x + 33 x^2 + x^3 - x^4)/(1 - x)^7, {x, 0, 32}], x] (* Michael De Vlieger, Dec 12 2016 *)
  • PARI
    concat(0, Vec(2*x^2*(2 + 25*x + 33*x^2 + x^3 - x^4) / (1 - x)^7 + O(x^50))) \\ Colin Barker, Dec 12 2016

Formula

a(n) = (n^6 - 5*n^4 + 6*n^3 - 2*n^2)/6.
a(n) = 7*a(n-1) - 21*a(n-2) + 35*a(n-3) - 35*a(n-4) + 21*a(n-5) - 7*a(n-6) + a(n-7).
G.f.: 2*x^2*(2 + 25*x + 33*x^2 + x^3 - x^4) / (1 - x)^7. - Colin Barker, Dec 12 2016

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

Original entry on oeis.org

0, 0, 4, 0, 10, 20, 0, 16, 34, 48, 0, 22, 44, 70, 88, 0, 28, 58, 88, 118, 140, 0, 34, 68, 102, 140, 178, 204, 0, 40, 82, 124, 166, 208, 250, 280, 0, 46, 92, 142, 184, 238, 284, 334, 368, 0, 52, 106, 156, 214, 268, 318, 376, 430, 468, 0, 58, 116, 178, 236, 290
Offset: 1

Views

Author

Lars Blomberg, Feb 27 2017

Keywords

Comments

T(n,k) = A279433(n,k) + A280652(n,k) + A280653(n,k).
It appears that the main diagonal is 4*A000326.

Examples

			Triangle begins:
0
0,4
0,10,20
0,16,34,48
0,22,44,70,88
0,28,58,88,118,140
0,34,68,102,140,178,204
0,40,82,124,166,208,250,280
0,46,92,142,184,238,284,334,368
0,52,106,156,214,268,318,376,430,468
0,58,116,178,236,290,356,418,476,538,580
0,64,130,196,262,328,394,460,526,592,658,704
-----
A right angle is marked 'r', an obtuse one 'o'.
For n=2, k=2
rx   xr   x.   .x
x.   .x   rx   xr
So T(2,2)=4.
-----
For n=3, k=2
xo.   r.x   x.x   x.r   x..   x..   .ox   .r.   ..x   ..x
..x   x..   .r.   ..x   r.x   .ox   x..   x.x   xo.   x.r
So T(3,2)=10.
		

Crossrefs

Cf. A045996.
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 A279433 for all right triangles.
See A280652 for all obtuse triangles.
See A280653 for all acute triangles.

A194193 Square array read by antidiagonals downwards: T(n,k) = number of ways to arrange k indistinguishable points on an n X n square grid so that no three points are collinear at any angle.

Original entry on oeis.org

1, 0, 4, 0, 6, 9, 0, 4, 36, 16, 0, 1, 76, 120, 25, 0, 0, 78, 516, 300, 36, 0, 0, 28, 1278, 2148, 630, 49, 0, 0, 2, 1668, 9498, 6768, 1176, 64, 0, 0, 0, 998, 25052, 47331, 17600, 2016, 81, 0, 0, 0, 204, 36698, 215448, 175952, 40120, 3240, 100, 0, 0, 0, 11, 26700, 620210
Offset: 1

Views

Author

R. H. Hardin, Aug 18 2011

Keywords

Comments

Columns 4..7 are A175383, A194190, A194191, A194192 respectively. - Heinrich Ludwig, Nov 16 2016

Examples

			Table starts:
...1.....0.......0........0..........0...........0............0............0
...4.....6.......4........1..........0...........0............0............0
...9....36......76.......78.........28...........2............0............0
..16...120.....516.....1278.......1668.........998..........204...........11
..25...300....2148.....9498......25052.......36698........26700.........8242
..36...630....6768....47331.....215448......620210......1073076......1035097
..49..1176...17600...175952....1189868.....5367308.....15657764.....28228158
..64..2016...40120...545764....5199888....34678364....159413700....491910848
..81..3240...82608..1461672...18520572...169259212...1108580092...5122725512
.100..4950..157252..3507553...56978440...682686652...6030207624..38914424892
.121..7260..280988..7701638..155627304..2356999994..26852315940.229093733030
.144.10296..477012.15773526..388897892..7294368210.104865006648
.169.14196..775172.30375194..894254904.20227526910
.196.19110.1214768.55695587.1932504496
.225.25200.1844512.97777392
.256.32640.2725000
...
Some solutions for n=4, k=4:
..0..0..1..0....0..0..0..0....0..0..0..0....0..0..1..0....1..0..0..0
..1..0..0..0....1..0..0..0....0..0..1..0....1..0..0..0....0..0..0..1
..0..0..0..0....0..1..0..1....1..0..1..0....1..0..0..0....0..0..0..1
..0..0..1..1....0..1..0..0....0..1..0..0....0..0..0..1....1..0..0..0
		

Crossrefs

Column 1 is A000290.
Column 2 is A083374.
Column 3 is A045996.
Column 4 is A175383.
Column 5 is A194190.
Column 6 is A194191.
Column 7 is A194192.

A241223 Number of triangles on a centered hexagonal grid of size n.

Original entry on oeis.org

0, 32, 900, 7380, 34676, 118044, 325872, 775856, 1653888, 3237984, 5923028, 10249596, 16938588, 26924036, 41393424, 61830480, 90059672, 128293728, 179185500, 245889068, 332107188, 442162836, 581060024, 754545360, 969196896, 1232477192, 1552824900
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.

Examples

			For n = 2 the 32 triangles are the following:
/. *     * *     * .     . .     . .     . .     . *     * *
. * *   . * .   * * .   * * .   . * .   . * *   * . *   . . .
\. .     . .     . .     * .     * *     . *     . .     * .
-
/* .     . .     . *     * .     . *     * *     * .     . *
* . .   * . *   . . .   . . *   . . *   . . .   * . *   * . .
\. *     * .     * *     . *     * .     . *     . .     * .
-
/* .     . .     * *     * *     * .     . .     . .     . *
. . .   * . *   . . *   * . .   * . .   * . .   . . *   . . *
\* *     . *     . .     . .     * .     * *     * *     . *
-
/* .     . *     * .     . .     . .     . *     * .     . *
. * *   * * .   . * .   * * .   . * *   . * .   . . *   * . .
\. .     . .     * .     . *     * .     . *     * .     . *
		

Crossrefs

Cf. A045996.

Formula

a(n) = A240826(n) - A241222(n).
a(n) = A241224(n) + A241225(n) + A241226(n) = A241227(n) + A241228(n).

Extensions

a(7) from Martin Renner, May 31 2014
a(8)-a(22) from Giovanni Resta, May 31 2014
Terms a(23) and beyond from Andrew Howroyd, Sep 18 2017

A334705 Triangle read by rows: T(n,k) (1 <= k <= n) = number of ways to choose three points from an n X k grid of points which are the vertices of a triangle of nonzero area.

Original entry on oeis.org

0, 0, 4, 0, 18, 76, 0, 48, 200, 516, 0, 100, 412, 1056, 2148, 0, 180, 738, 1884, 3820, 6768, 0, 294, 1200, 3052, 6176, 10922, 17600, 0, 448, 1824, 4628, 9352, 16516, 26588, 40120, 0, 648, 2632, 6668, 13456, 23740, 38192, 57588, 82608, 0, 900, 3650, 9232, 18612, 32812, 52758, 79508, 114000, 157252
Offset: 1

Views

Author

N. J. A. Sloane, Jun 13 2020

Keywords

Comments

It follows from the definitions that T(n,k) + A334704(n,k) = A334703(n,k) for 1 <= k <= n.

Examples

			Triangle begins:
0,
0, 4,
0, 18, 76,
0, 48, 200, 516,
0, 100, 412, 1056, 2148,
0, 180, 738, 1884, 3820, 6768,
0, 294, 1200, 3052, 6176, 10922, 17600,
0, 448, 1824, 4628, 9352, 16516, 26588, 40120,
0, 648, 2632, 6668, 13456, 23740, 38192, 57588, 82608,
0, 900, 3650, 9232, 18612, 32812, 52758, 79508, 114000, 157252,
0, 1210, 4900, 12380, 24940, 43934, 70608, 106364, 152456, 210234, 280988,
...
This is the lower half of a symmetric array. The full symmetric array begins:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
0, 4, 18, 48, 100, 180, 294, 448, 648, 900, 1210, 1584, ...
0, 18, 76, 200, 412, 738, 1200, 1824, 2632, 3650, 4900, 6408, ...
0, 48, 200, 516, 1056, 1884, 3052, 4628, 6668, 9232, 12380, 16176, ...
0, 100, 412, 1056, 2148, 3820, 6176, 9352, 13456, 18612, 24940, 32568, ...
0, 180, 738, 1884, 3820, 6768, 10922, 16516, 23740, 32812, 43934, 57336, ...
0, 294, 1200, 3052, 6176, 10922, 17600, 26588, 38192, 52758, 70608, 92112, ...
0, 448, 1824, 4628, 9352, 16516, 26588, 40120, 57588, 79508, 106364, 138708, ...
0, 648, 2632, 6668, 13456, 23740, 38192, 57588, 82608, 114000, 152456, 198760, ...
0, 900, 3650, 9232, 18612, 32812, 52758, 79508, 114000, 157252, 210234, 274016 , ...
0, 1210, 4900, 12380, 24940, 43934, 70608, 106364, 152456, 210234, 280988, 366152, ...
...
		

Crossrefs

This is a companion to the triangles A334703 and A334704.
Rows (or columns) 2,3,4,5 of the full array are A045991, A262402, A296367, A334707. The main diagonal is A045996.

Extensions

Rows 6 onwards from Tom Duff (see the Duff link in A334704). - N. J. A. Sloane, Jun 19 2020
Showing 1-10 of 21 results. Next