All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Some Near Pythagorean Integers Sum to Squares (Posted on 2023-08-11) Difficulty: 3 of 5
Consider five positive integers a, b, c, d, and p, with gcd(a,b,c)=1, that satisfy this system of equations:
  • a, b, and c are different positive integers.
  • a2+b2+c2=d2
  • a+b+c=p2
Determine the four smallest values of a+b+c+d+p.

*** Computer program/excel solver assisted solutions are welcome, but a semi-analytic (p&p and hand calculator) methodology is preferred.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 3
clearvars,clc
sols=double.empty(0,6);
for a=1:500
  for b=a+1:501
    ab2=a^2+b^2;
    for c=b+1:502
      if gcd(gcd(a,b),c)==1
        p2=a+b+c;
        if round(sqrt(p2))^2==p2
          d2=ab2+c^2;
          if round(sqrt(d2))^2==d2
            fprintf('%5d %5d %5d %5d %5d %7d ',...
              [a b c sqrt(d2) sqrt(p2)], sum([a b c sqrt(d2) sqrt(p2)]))
            sols(end+1,:)=[a b c sqrt(d2) sqrt(p2) sum([a b c sqrt(d2) sqrt(p2)])];
          end
        end
      end
    end
  end
end
sols=sortrows(sols,6);
sols(1:10,:)

produces, at the end, the ten lowest sums:


     a     b     c     d     p   sum
     
     1     6    18    19     5    49
    12    16    21    29     7    85
     6    21    22    31     7    87
     4    17    28    33     7    89
     1    18    30    35     7    91
     6    10    33    35     7    91
    30    45    46    71    11   203
    28    36    57    73    11   205
    25    34    62    75    11   207
    18    34    69    79    11   211

Of course a, b, and c can be permuted in each case.
    
The first four satisfy the requirements.

All the solutions up to a total of 500 are (showing there's a tie for 10th place):

sols =
           1           6          18          19           5          49
          12          16          21          29           7          85
           6          21          22          31           7          87
           4          17          28          33           7          89
           1          18          30          35           7          91
           6          10          33          35           7          91
          30          45          46          71          11         203
          28          36          57          73          11         205
          25          34          62          75          11         207
          18          34          69          79          11         211
          21          30          70          79          11         211
           8          49          64          81          11         213
           4          45          72          85          11         217
          13          26          82          87          11         219
           9          28          84          89          11         221
           6          13         102         103          11         235
          49          50          70          99          13         281
          36          61          72         101          13         283
          25          68          76         105          13         287
          40          41          88         105          13         287
          36          37          96         109          13         291
          14          70          85         111          13         293
          30          33         106         115          13         297
           4          77          88         117          13         299
          28          32         109         117          13         299
           6          61         102         119          13         301
           4          60         105         121          13         303
          21          28         120         125          13         307
          93          94         102         167          17         473
          69          88         132         173          17         479
          72          84         133         173          17         479
          66          85         138         175          17         481
          49         112         128         177          17         483
          54          90         145         179          17         485
          45         100         144         181          17         487
          38         109         142         183          17         489
          58          74         157         183          17         489
          36         105         148         185          17         491
          40          96         153         185          17         491
          40          85         164         189          17         495
          21         126         142         191          17         497
          34          90         165         191          17         497
          
          
           . . .

Edited on August 11, 2023, 9:03 am
  Posted by Charlie on 2023-08-11 09:01:04

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information