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.
After trying 88, 888 and 8888 endings, I adjusted the starting point and increment for this. That sped up the time required.
for i=1942:2500:99999999
p=powermod(i,3,100000000);
if p==88888888
disp([i sym(i)^3])
end
end
The full output is
n n^3
[11576942, 1551606436464188888888]
[36576942, 48935291641816488888888]
[61576942, 233482509347168788888888]
[86576942, 648943259552521088888888]
so the first one is 11576942 whose cube is 1551606436464188888888.
|
Posted by Charlie
on 2023-06-20 09:26:16 |