Find as many positive integers, N, not ending in 0, as you can, such that N^3 contains both N and N^2.
I found 3 solutions
N N^2 N^3
1 1 1
5 25 125
25 625 15625
I do not have a proof that there are no other solutions.
--------------
big = 100000000
squares = [str(n*n) for n in range(big+1)]
cubes = [str(n*n*n) for n in range(big+1)]
for n in range(big+1):
sn = str(n)
if sn[-1] == '0':
continue
if sn in cubes[n] and squares[n] in cubes[n]:
print(sn,squares[n], cubes[n])
|
Posted by Larry
on 2023-10-26 11:36:02 |