# Pseudo Diophantine equation - sum of 3 cubes

## Description

J E Patterson 20190928

## Introduction

Published 3 cubes solutions can be derived from just a few least significant digits of, what can sometimes be extremely large, numbers. This 37 step program calculates the sum of cubes for 3 numbers using just the 3 least significant digits in each term.

Numbers are truncated to three digits using FRAC. Negative numbers are complimented by having 1000 added to them to make a new positive number. Each 3 digit number is cubed and they are summed. Finally the result is truncated to 3 digits again, using FRAC, leaving just the published 3 cubes sum.

This little discovery is probably obvious to mathematicians, but I found it interesting.

It was also interesting to not truncate the final sum. Using two digits from the first example below the result is 50742. Using three digits the result was 387848042. Using four digits the result was 668216100042. At this point the significant digit range of the hp-15c is exceeded so this was calculated using Thomas Okken's Free42 simulator.

Another option is to use Wolfram Alpha. For example 751458175153 + (100000000000 - 38812075974)3 + 232973356313 = 666070721166961397611075000000042. The number of zeros seen increases to just 15 when all the significant digits are in place, producing 529784370469658641488703464414602800000000000000042. Removing the now fully expanded 100000000000000000 leaves a result of 42.

Taking simple cubes produced sums ending in 058 for two digits, 9958 for three, 0042 for four and 99958 for five digits.

The links below are representative of many on this subject. The first is a research paper by Andrew Booker for the number 33. The second is a general article about the solution for 42 which has better researched content than most.

Cracking the problem with 33
The Sum of Three Cubes Problem For 42 Has Just Been Solved

## Calculation

Enter the last 3 digits (or more) of each number.
The 3 numbers are now in x, y and z on the stack.

GSB A

The sum of cubes is displayed.

This program produces the same results as a full summation of cubes for sums less than 1000.

## Examples

804357581458175153−805387388120759743+126021232973356313 = 42

7515 ENTER
5974 CHS ENTER
5631 GSB A

42 is displayed

23+23-13 = 15

2 ENTER
2 ENTER
1 CHS GSB A

15 is displayed

5699368212219623807203−5699368211135634935093−4727154934533270323 = 3

720 ENTER
493509 CHS ENTER
7032 CHS GSB A

3 is displayed

88661289752875283−87784054428622393−27361114688070403 = 33

7528 ENTER
62239 CHS ENTER
807040 CHS GSB A

33 is displayed

88661289752875283−87784054428622393−27361114688070403 = 33

528 ENTER
862239 CHS ENTER
7040 CHS GSB A

33 is displayed

## Program Resources

### Labels

Name Description
A Calculate cube sum
B Isolate last 3 digits
C Test if negative

Name Description
1 x1
2 x2
3 x3

## Program

Line Display Key Sequence Line Display Key Sequence
000 019 3 3
001 42,21,11 f LBL A 020 10 ÷
002 44 1 STO 1 021 42 44 f FRAC
003 33 R⬇ 022 26 EEX
004 44 2 STO 2 023 3 3
005 33 R⬇ 024 20 ×
006 44 3 STO 3 025 43 32 g RTN
007 45 1 RCL 1 026 42,21,13 f LBL C
008 32 13 GSB C 027 32 12 GSB B
009 45 2 RCL 2 028 43,30, 2 g TEST x<0
010 32 13 GSB C 029 32 14 GSB D
011 40 + 030 3 3
012 45 3 RCL 3 031 14
013 32 13 GSB C 032 43 32 g RTN
014 40 + 033 42,21,14 f LBL D
015 32 12 GSB B 034 26 EEX
016 43 32 g RTN 035 3 3
017 42,21,12 f LBL B 036 40 +
018 26 EEX 037 43 32 g RTN