|
| |
|
|
A051519
|
|
Exactly n integer-sided triangles of perimeter a(n) have integer area.
|
|
1
| |
|
|
12, 32, 48, 36, 64, 98, 160, 84, 128, 168, 144, 108, 416, 196, 192, 216, 288, 256, 780, 336, 294, 612, 396, 378, 1026, 392, 448, 420, 512, 324, 600, 792, 800, 432, 484, 540, 1000, 810, 676, 576, 1760, 2842, 1250, 648, 726, 924, 980, 2484, 1134, 864, 1210, 784
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,1
|
|
|
LINKS
| Randall L Rathbun (randyr(AT)nethere.com), Jan 29 2007, Table of n, a(n) for n = 1..229
|
|
|
PROG
| #include <stdio.h> /* printf() */ #include <math.h> /* sqrt() round() */ unsigned int is_triangle(a, b, c) int a, b, c; { double s, A, B; s = (a+b+c)/2.0; A = s*(s-a)*(s-b)*(s-c); B = floor(sqrt(A)+0.1); if ( B*B == A && A > 0.0 ) return 1; else return 0; } int main() { int set; int a, b, c, p; for (p=1; p<15001; p++) { printf("%d ", p); set = 0; for (a=1; a<p; a++) { for (b=a; b<p; b++) { c = p-a-b; if (c >=b && c < a+b && b < a+c && a < b+c ) { if (is_triangle(a, b, c)) { set += 1; printf("[%d %d %d] ", a, b, c); } } } } printf(" "); printf("perimeter %d = %d ", p, set); } return 0; } - Randall L. Rathbun (randyr(AT)nethere.com), Jan 26 2007
|
|
|
CROSSREFS
| Sequence in context: A031118 A118785 A071336 * A166959 A134582 A177721
Adjacent sequences: A051516 A051517 A051518 * A051520 A051521 A051522
|
|
|
KEYWORD
| nonn
|
|
|
AUTHOR
| David W. Wilson (davidwwilson(AT)comcast.net)
|
|
|
EXTENSIONS
| More terms from Randall L. Rathbun (randyr(AT)nethere.com), Jan 26 2007
|
| |
|
|