Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Integer-sided right triangles will fit into a square: Integer sided right triangles in a square

but how about integer-sided non-right triangles? Here's a near miss - they don't quite fit like this: a near miss

Is it possible?

share|improve this question
1  
It looks like the British flag theorem might be useful. –  Zubin Mukerjee May 7 at 10:07
1  
How did you find the first case? –  Sawarnik May 7 at 10:07
2  
It wasn't me that found it. Penny Drastik, a primary student at The Illawarra Grammar School in Australia, aged 10, found it: link –  Simon G May 7 at 10:21

1 Answer 1

up vote 3 down vote accepted

Square Triangle

I just used a hastily written electronic computer program:

// gcc british_flag.c -o british_flag.exe -std=c99 -Wall -O3

#include <stdio.h>

static int square(int x);
static int is_square(int x, int* square_root);

#define MAX 50

int main() {
  int z11, z12, z21, z22;

  int solution_exists[MAX][MAX];

  for (int x = 0; x < MAX; x++) {
    for (int y = 0; y < MAX; y++) {
      solution_exists[x][y] = 0;
    }
  }

  for (int x = 1; x < MAX; x++) 
  for (int y = 1; y < MAX; y++) 
  for (int x2 = 1; x2 < x; x2++) 
  for (int y2 = 1; y2 < y; y2++) {
    int x1 = x - x2;
    int y1 = y - y2;

    if (is_square(x1*x1 + y1*y1, &z11)
     && is_square(x2*x2 + y1*y1, &z21)
     && is_square(x1*x1 + y2*y2, &z12)
     && is_square(x2*x2 + y2*y2, &z22)
    ) {
      if ( square(x) == square(z11) + square(z21) ) continue;
      if ( square(x) == square(z12) + square(z22) ) continue;
      if ( square(y) == square(z11) + square(z12) ) continue;
      if ( square(y) == square(z21) + square(z22) ) continue;
      printf("(%d, %d) %d %d by %d %d\n", x, y, x1, x2, y1, y2);
      solution_exists[x][y] = 1;
    }
  }

  return 0;
}

static int square(int x) {
  return x*x;
}




static int is_square(int x, int* square_root) {
  int min = 0;
  int max = x;

  while(1) {
    *square_root = (min + max)/2;
    if (*square_root * *square_root == x) return 1;
    if (min >= max) return 0;

    if (*square_root * *square_root <  x) {
      min = *square_root + 1;
    }
    if (*square_root * *square_root >  x) {
      max = *square_root - 1;
    }
  }
}

Not very insightful but I suspect (and I'm sure someone can prove) that no solution exists which is only made of 4 triangle meeting at a single point in the middle. It also leaves behind the question of what the fewest number of triangles possible is.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.