4
$\begingroup$

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?

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

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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