Sum of Squares 2

a a , b b , c c , d d , e e , f f , g g , h h , and j j are all distinct, positive integers such that a 2 + b 2 = c 2 + d 2 = e 2 + f 2 = g 2 + h 2 = j a^2 + b^2 = c^2 + d^2 = e^2 + f^2 = g^2 + h^2 = j .

What is the smallest possible value of j j ?

Inspiration


The answer is 1105.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Joshua Lowrance
Mar 2, 2019

1105 = 3 3 2 + 4 2 = 3 2 2 + 9 2 = 3 1 2 + 1 2 2 = 2 4 2 + 2 3 2 1105 = 33^2 + 4^2 = 32^2 + 9^2 = 31^2 + 12^2 = 24^2 + 23^2

I challenge you to prove that this is the smallest example :)

Continuing on, the relevant sequences are here and here .

Brian Charlesworth - 2 years, 3 months ago

Log in to reply

Sir,may I know how you found those sequences? Is there a way to type words or you knew first few terms already?

Mr. India - 2 years, 3 months ago

Log in to reply

I just typed in the first three terms, namely (2,50,325), and OEIS responded with these sequences.

Brian Charlesworth - 2 years, 3 months ago

Thank you, @Brian Charlesworth !

Joshua Lowrance - 2 years, 3 months ago

I don't know how to prove it minimum, but I guess that as 1105 = 5×13×17 and all these primes are 4k+1 this is reason

Mr. India - 2 years, 3 months ago

@Brian Charlesworth thank you somebody explains how people find these answers it was going to take my computer literally like 10 years (or maybe 1 week idk) to check all 25,000,000 possible sets of 8 integers FROM 0 TO 20 NOT EVEN SCRAPING THE SURFACE SHEESH to see if the sum of the first one squared plus the second one squared was the same as third and fourth fifth and sixth seventh and eighth

so it was inefficient code and these people on the OEIS probably have super efficient recursive algorithms and an army of supercomputers

mines great for finding (2+4+0+1)⁴ = 2401 in a split second and some other stuff over time but 25,000,000 i wouldntve even gotten to having sets of numbers with 33

and here I was feeling so intimidated thinking people were in on some secret about exponents and modular arithmetic but meanwhile its just because I didnt have a big enough computer and OEIS did

anyways heres my code

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
var nbs = [0, 0, 0, 0, 0, 0, 0, 0];

var a, b, c, d, e, f, g, h;

var reset = function(dir) {
    if (dir) {
        a = nbs[0];
        b = nbs[1];
        c = nbs[2];
        d = nbs[3];
        e = nbs[4];
        f = nbs[5];
        g = nbs[6];
        h = nbs[7];
        return;
    }
    nbs[0] = a;
    nbs[1] = b;
    nbs[2] = c;
    nbs[3] = d;
    nbs[4] = e;
    nbs[5] = f;
    nbs[6] = g;
    nbs[7] = h;
};

var tested = 30;

var test = function(txt) {
    if (tested --> 0) {
        println(txt);
    }
};

var threshold = 10;

var flr = 0;

reset(true);

textSize(25);

var draw = function() {
    speed: for (var i=0; i<2e3; i++) {
        a++;
        if (a>threshold) {
            a=flr;
            b++;
            if (b>threshold) {
                b=flr;
                c++;
                if (c>threshold) {
                    c=flr;
                    d++;
                }
            }
        }
        if (d>threshold) {
            d=flr;
            e++;
            if (e>threshold) {
                e=flr;
                f++;
                if (f>threshold) {
                    f=flr;
                    g++;
                }
            }
        }
        if (g>threshold) {
            g=flr;
            h++;
        }
        reset();
        if (h>threshold) {
            // well
            var hmm = threshold;
            // flr = hmm+1;
            threshold = threshold+2;
            h = flr;
            // for (var n1 in nbs) {
            //     nbs[n1] = flr;
            // }
        }
        reset(true);
        for (var n1 in nbs) {
            for (var n2 in nbs) {
                if (nbs[n1] === nbs[n2]) {
                    continue speed;
                }
            }
        }
        var j = [a*a+b*b, c*c+d*d, e*e+f*f, g*g+h*h];
        if (j[0] === j[1]) {
            test(nbs);
        }
        for (var n1 in j) {
            for (var n2 in j) {
                if (j[n1] !== j[n2]) {
                    continue speed;
                }
            }
        }
        test(nbs);
    }
    if (frameCount%10 === 0) {
    background(255);
    fill(255, 0, 0);
    text(nbs.join("\n"), 20, 40);
    text(threshold, 200, 300);
    }
};

it woulda found the answer after, like, an infinite amount of time

chase marangu - 2 years, 2 months ago

Log in to reply

Impressive program! OEIS is a very useful site if you know the first few terms of a sequence, but if you weren't aware of OEIS this problem would have been impossible. I agree that this problem might be more suitably categorized under Computer Science. The C. Rivera, Puzzle 62 reference in the first of my links does have a discussion of an analytic approach, but it is not particularly easy to follow.

Brian Charlesworth - 2 years, 2 months ago

Log in to reply

Interesting article, if a bit hard to follow. Apparently it has to do something with polynomials and primes. @Joshua Lowrance probably put it as Number Theory to troll people, a good reason if you ask me because that's hilarious, with the justification that it is technically related to Number theory.

chase marangu - 2 years, 2 months ago

not pure js btw put it here: https://www.khanacademy.org/computer-programming/new/pjs

chase marangu - 2 years, 2 months ago

looking back, I think if instead of checking the a 2 + b 2 = c 2 + d 2 . . . a^2+b^2=c^2+d^2... of every possible set of eight unique numbers I checked what sums of squares added up to any given number (by starting with, say, a = j a=\left \lfloor{\sqrt{j}}\right \rfloor{} and setting b b to 0 0 , then incrementing b b until a 2 + b 2 > j a^2+b^2>j then going back one step for b b , then doing similar things for the other numbers it might've been much faster at finding an answer

chase marangu - 2 years, 2 months ago

Log in to reply

That is exactly what I did. Except I was dumb and didn't use computer programming ... I actually wrote out all the answers every possible sum of a 2 + b 2 a^2 + b^2 , hehe

Joshua Lowrance - 2 years, 2 months ago

Log in to reply

yes good work manually finding the sums of squares that added up to the number even if u did knew what number to add them up to

chase marangu - 2 years, 2 months ago
X X
Mar 3, 2019

I tried ( 1 2 + 2 2 ) ( 2 2 + 3 2 ) ( 1 2 + 4 2 ) (1^2+2^2)(2^2+3^2)(1^2+4^2) and it worked!

This kind of problems we will just have to multiply the numbers in the form of a 2 + b 2 a^2+b^2 together.

So, why didn't you try 1 2 + 3 2 1^2+3^2 instead of 1 2 + 4 2 1^2+4^2 ?? Also, please provide a proof.

Mr. India - 2 years, 3 months ago

Log in to reply

( a 2 + b 2 ) ( c 2 + d 2 ) = ( a + b i ) ( a b i ) ( c + d i ) ( c d i ) = ( a + b i ) ( c + d i ) ( a b i ) ( c d i ) (a^2+b^2)(c^2+d^2)=(a+bi)(a-bi)(c+di)(c-di)=(a+bi)(c+di)(a-bi)(c-di)

= ( ( a c b d ) + ( a d + b c ) i ) ( ( a c b d ) ( a d + b c ) i ) = ( a c b d ) 2 + ( a d + b c ) 2 =((ac-bd)+(ad+bc)i)((ac-bd)-(ad+bc)i)=(ac-bd)^2+(ad+bc)^2

So, ( a 2 + b 2 ) ( c 2 + d 2 ) = ( a c b d ) 2 + ( a d + b c ) 2 = ( a d b c ) 2 + ( a c + b d ) 2 (a^2+b^2)(c^2+d^2)=(ac-bd)^2+(ad+bc)^2=(ad-bc)^2+(ac+bd)^2

I just wanted to show that we can do it this way, but I think it'll not be hard to prove that 1105 is the smallest.

X X - 2 years, 3 months ago

Log in to reply

Nice, it was completely new to me!

Mr. India - 2 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...