Determine the minimum value of a positive base ten integer N, such that each of the last eight digits of N3 is 8 but the ninth digit from the right in N3 is NOT 8.
n^3 ends in 8 if n ends in 2
n^3 ends in 88 if n ends in 42 + k*50
n^3 ends in 888 if n ends in 442 + k*250
n^3 ends in 8888 if n ends in 1942 + k*2500
n^3 ends in 88888 if n ends in 1942 + k*25000
n^3 ends in 888888 if n ends in 76942 + k*250000
n^3 ends in 8888888 if n ends in 1576942 + k*2500000
n^3 ends in 88888888 if n ends in 11576942 + k*25000000
So the requested value for N is
11576942N^3 = 1551606436464188888888
Determined with the small program below sequentially altering the number of final 8s and adjusting the limits for the loop accordingly.
"""
big = 100000000
for n in range(1576942,big,2500000):
s = str(n**3)[-9:]
if s[-8:] == '88888888':
print(n, n**3, s)
|
Posted by Larry
on 2023-06-20 09:07:20 |