 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Powers of 3 (Posted on 2016-08-25) Find powers of 3 which can be written as the sum of the kth powers (k > 1) of two coprime integers.

 No Solution Yet Submitted by Ady TZIDON No Rating Comments: ( Back to comment list | You must be logged in to post comments.) Computer exploration | Comment 1 of 5
DefDbl A-Z
Dim crlf\$

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

p3 = 3
For base3 = 2 To 31
p3 = p3 * 3
k = 1
Do
k = k + 1
n1 = 1
t1 = n1
didOne = 0
Do
n1 = n1 + 1
t1 = Int(n1 ^ k + 0.5)
If t1 > p3 Then Exit Do
didOne = 1
t2 = p3 - t1
n2 = Int(t2 ^ (1 / k) + 0.5)
If t2 = Int(n2 ^ k + 0.5) And t2 > 1 Then
'  If gcd(n1, n2) = 1 Then
Text1.Text = Text1.Text & base3 & Str(p3) & " = " & n1 & "^" & k & "+" & n2 & "^" & k
Text1.Text = Text1.Text & "   " & gcd(n1, n2) & crlf
ct = ct + 1
'  End If
End If
DoEvents
Loop
Loop Until didOne = 0
Next

Text1.Text = Text1.Text & crlf & ct & " done"

End Sub

Function gcd(a, b)
x = a: y = b
Do
q = Int(x / y)
z = x - q * y
x = y: y = z
Loop Until z = 0
gcd = x
End Function

was originally written to check that the two integers were coprime, but no solutions were found, so that condition was commented out.  The results now show that all the solutions have two numbers that are multiples of 3, and the powers (k) are all 3. The gcd's of the two numbers are all powers of 3.

power
of 3                                                       gcds

3^5  = 243 = 3^3+6^3   3
3^5  = 243 = 6^3+3^3   3
3^8  = 6561 = 9^3+18^3   9
3^8  = 6561 = 18^3+9^3   9
3^11 = 177147 = 27^3+54^3   27
3^11 = 177147 = 54^3+27^3   27
3^14 = 4782969 = 81^3+162^3   81
3^14 = 4782969 = 162^3+81^3   81
3^17 = 129140163 = 243^3+486^3   243
3^17 = 129140163 = 486^3+243^3   243
3^20 = 3486784401 = 729^3+1458^3   729
3^20 = 3486784401 = 1458^3+729^3   729
3^23 = 94143178827 = 2187^3+4374^3   2187
3^23 = 94143178827 = 4374^3+2187^3   2187
3^26 = 2541865828329 = 6561^3+13122^3   6561
3^26 = 2541865828329 = 13122^3+6561^3   6561
3^29 = 68630377364883 = 19683^3+39366^3   19683
3^29 = 68630377364883 = 39366^3+19683^3   19683

Edited on August 25, 2016, 2:12 pm
 Posted by Charlie on 2016-08-25 14:11:11 Please log in:

 Search: Search body:
Forums (3)