Consider the digital expansion of this duodecimal fraction:
(4)12
--------
(19)12
Determine the (419)
12th duodecimal digit to the right of the duodecimal point.
clearvars,clc
f=sym(4/21);
n=f; build=[];
for i=1:1000
build=[build floor(n*12)];
n=n*12-build(end);
end
fprintf(' %2d',build)
fprintf('\n')
pos=4*144+12+9
produces
2 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6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 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1 8 6 10 3 5 1
pos =
597
you can either count out to the 597th number (representing duodecimal digits), or recognize it repeats in a cycle of 6 after the initial single digit (2).
So, since we want the 597th position (decimal), subtract 1, making it the 596the position in the repeating area,
>> mod(596,6)
ans =
2
tells us it's the second digit in the repeating sequence, so it is 5.
>> build(597)
ans =
5
confirms the 5.
An aside: during the development of the digits, n (the fractional remainder), varies in a cycle: 3/7, 1/7, 5/7, 4/7, 6/7, 2/7, along with the resulting new digit.
|
Posted by Charlie
on 2023-03-11 09:20:32 |