How many ordered triples (a, b, n) of positive integers would satisfy the equation a2 + b4 = 5n?
I found 6:
a b n
2 1 1
3 2 2
50 5 5
75 10 6
1250 25 9
1875 50 10
2 1 1 4+1=5
3 2 2 9+16=25
50 5 5 2500+625=3125
75 10 6 5625+10000=15625
1250 25 9 1562500+390625=1953125
1875 50 10 3515625+6250000=9765625
-----------
import math
big = 10000
squares = [i**2 for i in range(1,big)]
fourths = [i**4 for i in range(1,big)]
maxsum = squares[-1] + fourths[-1]
toppowerof5 = int(math.log(maxsum,5)) + 1
fifths = [5**i for i in range(1,toppowerof5+1)]
for ax in squares:
for bx in fourths:
for nx in fifths:
if ax + bx == nx:
print(squares.index(ax)+1,
fourths.index(bx)+1,
fifths.index(nx)+1)
|
Posted by Larry
on 2025-02-05 13:51:17 |