How to resolve the algorithm Euler's sum of powers conjecture step by step in the 360 Assembly programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Euler's sum of powers conjecture step by step in the 360 Assembly programming language

Table of Contents

Problem Statement

There is a conjecture in mathematics that held for over two hundred years before it was disproved by the finding of a counterexample in 1966 by Lander and Parkin. This conjecture is called Euler's sum of powers conjecture and can be stated as such: In 1966, Leon J. Lander and Thomas R. Parkin used a brute-force search on a CDC 6600 computer restricting numbers to those less than 250. The task consists in writing a program to search for an integer solution of

x

0

5

x

1

5

x

2

5

x

3

5

=

y

5

{\displaystyle x_{0}^{5}+x_{1}^{5}+x_{2}^{5}+x_{3}^{5}=y^{5}}

where all

x

i

{\displaystyle x_{i}}

and

y

{\displaystyle y}

are distinct integers between 0 and 250 (exclusive). Show an answer here. Related tasks are:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Euler's sum of powers conjecture step by step in the 360 Assembly programming language

Source code in the 360 programming language

 EULERCO  CSECT
         USING  EULERCO,R13
         B      80(R15)
         DC     17F'0'
         DC     CL8'EULERCO'
         STM    R14,R12,12(R13)
         ST     R13,4(R15)
         ST     R15,8(R13)
         LR     R13,R15
         ZAP    X1,=P'1'
LOOPX1   ZAP    PT,MAXN            do x1=1 to maxn-4
         SP     PT,=P'4'
         CP     X1,PT
         BH     ELOOPX1
         ZAP    PT,X1
         AP     PT,=P'1'
         ZAP    X2,PT
LOOPX2   ZAP    PT,MAXN            do x2=x1+1 to maxn-3
         SP     PT,=P'3'
         CP     X2,PT
         BH     ELOOPX2
         ZAP    PT,X2
         AP     PT,=P'1'
         ZAP    X3,PT
LOOPX3   ZAP    PT,MAXN            do x3=x2+1 to maxn-2
         SP     PT,=P'2'
         CP     X3,PT
         BH     ELOOPX3
         ZAP    PT,X3
         AP     PT,=P'1'
         ZAP    X4,PT
LOOPX4   ZAP    PT,MAXN            do x4=x3+1 to maxn-1
         SP     PT,=P'1'
         CP     X4,PT
         BH     ELOOPX4
         ZAP    PT,X4
         AP     PT,=P'1'
         ZAP    X5,PT              x5=x4+1
         ZAP    SUMX,=P'0'         sumx=0
         ZAP    PT,X1              x1
         BAL    R14,POWER5
         AP     SUMX,PT
         ZAP    PT,X2              x2
         BAL    R14,POWER5
         AP     SUMX,PT
         ZAP    PT,X3              x3
         BAL    R14,POWER5
         AP     SUMX,PT
         ZAP    PT,X4              x4
         BAL    R14,POWER5
         AP     SUMX,PT            sumx=x1**5+x2**5+x3**5+x4**5
         ZAP    PT,X5              x5
         BAL    R14,POWER5
         ZAP    VALX,PT            valx=x5**5
LOOPX5   CP     X5,MAXN            while x5<=maxn & valx<=sumx
         BH     ELOOPX5
         CP     VALX,SUMX
         BH     ELOOPX5
         CP     VALX,SUMX          if valx=sumx 
         BNE    NOTEQUAL
         MVI    BUF,C' '
         MVC    BUF+1(79),BUF      clear buffer
         MVC    WC,MASK
         ED     WC,X1              x1
         MVC    BUF+0(8),WC+8     
         MVC    WC,MASK
         ED     WC,X2              x2
         MVC    BUF+8(8),WC+8    
         MVC    WC,MASK
         ED     WC,X3              x3
         MVC    BUF+16(8),WC+8    
         MVC    WC,MASK
         ED     WC,X4              x4
         MVC    BUF+24(8),WC+8     
         MVC    WC,MASK
         ED     WC,X5              x5
         MVC    BUF+32(8),WC+8     
         XPRNT  BUF,80             output x1,x2,x3,x4,x5
         B      ELOOPX1
NOTEQUAL ZAP    PT,X5
         AP     PT,=P'1'
         ZAP    X5,PT              x5=x5+1
         ZAP    PT,X5
         BAL    R14,POWER5
         ZAP    VALX,PT            valx=x5**5
         B      LOOPX5
ELOOPX5  AP     X4,=P'1'
         B      LOOPX4
ELOOPX4  AP     X3,=P'1'
         B      LOOPX3
ELOOPX3  AP     X2,=P'1'
         B      LOOPX2
ELOOPX2  AP     X1,=P'1'
         B      LOOPX1
ELOOPX1  L      R13,4(0,R13)
         LM     R14,R12,12(R13)
         XR     R15,R15
         BR     R14
POWER5   ZAP    PQ,PT              ^1
         MP     PQ,PT              ^2
         MP     PQ,PT              ^3
         MP     PQ,PT              ^4
         MP     PQ,PT              ^5
         ZAP    PT,PQ
         BR     R14
MAXN     DC     PL8'249'
X1       DS     PL8
X2       DS     PL8
X3       DS     PL8
X4       DS     PL8
X5       DS     PL8
SUMX     DS     PL8
VALX     DS     PL8
PT       DS     PL8
PQ       DS     PL8
WC       DS     CL17            
MASK     DC     X'40',13X'20',X'212060'  CL17
BUF      DS     CL80
         YREGS  
         END

  

You may also check:How to resolve the algorithm Test a function step by step in the Insitux programming language
You may also check:How to resolve the algorithm Empty program step by step in the Visual Basic .NET programming language
You may also check:How to resolve the algorithm Random number generator (included) step by step in the XPL0 programming language
You may also check:How to resolve the algorithm Pig the dice game step by step in the Rust programming language
You may also check:How to resolve the algorithm Trigonometric functions step by step in the Visual Basic .NET programming language