Find the number of positive integers n such that 1 ≤ n ≤ 1000 and n is divisible by [n1/3]
(In reply to
Solution by Larry)
Here's the corrected list of M vs number, with the safeguarding of the cube roots of perfect cubes:
M number
10 9
100 40
1000 172
10000 746
100000 3343
1000000 15247
ct=0;M=10;
for m=1:6
for n=1:M
cr=floor(n^(1/3));
crr=round(n^(1/3));
if mod(n,cr) == 0 | crr^3==n
if crr^3==n
cr=crr;
end
ct=ct+1;
end
end
disp([M, ct])
M=M*10; ct=0;
end
|
Posted by Charlie
on 2020-12-14 13:39:20 |