Project Euler #136: Singleton difference

Sort by

recency

|

7 Discussions

|

  • + 0 comments

    Only the last test case not passing please help

  • + 2 comments

    YES! I did it!

  • + 1 comment

    With correct submissions around only 15% of total, I wonder why this problem was classified as "easy"...

  • + 0 comments

    way to solution

    13^2−10^2−7^2=20 (a+x)^2 - a^2 - (a-x)^2 = n

    a^2+2ax+x^2-a^2-(a^2-2ax+x^2) = n

    a^2+2ax+x^2-a^2-a^2+2ax-x^2 = n 4ax-a^2 = n a(4x-a) = n

    Since n, x and a are integers it raises following conditions,

    n%a==0;

    The interesing thing is that, n should be perfectly divisible by a

    4x-a = n/a 4x = n/a + a

  • + 1 comment

    Please find my unique solution. Requesting comment on this context for all.

    1) (3*3)-(2*2)-(1*1)=4 ;
    2) (8*8)-(6*6)-(4*4)=12;
    3) (5*5)-(3*3)-(1*1)=15;
    4) (6*6)-(4*4)-(2*2)=16;
    5) (13*13)-(10*10)-(7*7)=20;
    6) (12*12)-(9*9)-(6*6)=27;
    7) (18*18)-(14*14)-(10*10)=28;
    8) (7*7)-(4*4)-(1*1)=32;
    9) (8*8)-(5*5)-(2*2)=35;
    10) (9*9)-(6*6)-(3*3)=36;
    11) (17*17)-(13*13)-(9*9)=39;
    12) (28*28)-(22*22)-(16*16)=44;
    13) (16*16)-(12*12)-(8*8)=48;
    14) (22*22)-(17*17)-(12*12)=51;
    15) (33*33)-(26*26)-(19*19)=52;
    16) (9*9)-(5*5)-(1*1)=55;
    17) (10*10)-(6*6)-(2*2)=60;
    18) (11*11)-(7*7)-(3*3)=63;
    19) (12*12)-(8*8)-(4*4)=64;
    20) (43*43)-(34*34)-(25*25)=68;
    21) (20*20)-(15*15)-(10*10)=75;
    22) (48*48)-(38*38)-(28*28)=76;
    23) (26*26)-(20*20)-(14*14)=80;
    24) (11*11)-(6*6)-(1*1)=84;
    25) (37*37)-(29*29)-(21*21)=87;
    26) (12*12)-(7*7)-(2*2)=91;
    27) (58*58)-(46*46)-(34*34)=92;
    28) (25*25)-(19*19)-(13*13)=95;
    29) (13*13)-(8*8)-(3*3)=96;
    30) (14*14)-(9*9)-(4*4)=99;