All the positive perfect cubes 1, 8, 27, 64, 125, 216, 343, ... are written in accordance with strictly ascending order of magnitude and without the commas, resulting in the following infinite string:
182764125216343...........
Reading left to right, determine the 2023rd digit in the abovementioned string.
The 2023rd position is an 8 within 27818127, which is 303^3.
s='';
n=1;
while length(s)<2023
s=[s char(string(n^3))];
n=n+1;
end
s(2023)
finds
>> stringOfCubes
ans =
'8'
then I inquired:
>> n-1
ans =
303
>> ans^3
ans =
27818127
Then
>> length(s)
ans =
2028
shows that it's the first 8 in the 303^3 that is at position 2023.
|
Posted by Charlie
on 2023-12-12 09:31:47 |