2

I would like to know if there is a mathematically correct way of describing a sequence of decimal points of a given number.

e.g. position 35-46 of π

AKroell
  • 93

3 Answers3

2

What about using "floor", the integer part of a number, indicated by $\lfloor x\rfloor$? So $\pi - \lfloor\pi\rfloor$ is the decimal part of $\pi$. So $\lfloor (\pi-\lfloor\pi\rfloor) * 10^{46} \rfloor$ would give you the first $46$ decimal places. So $\left\lfloor(30{\Large(}(\pi-\lfloor\pi\rfloor)-\lfloor30(\pi-\lfloor\pi\rfloor)\rfloor{\Large)} * 16\right\rfloor$ would give you places $35$ to $46$. I think.

Gregory Grant
  • 14,874
  • Thats what I was looking for thank you!

    Would $\lfloor (\pi-\lfloor\pi\rfloor) * 10^{46} \rfloor$ - $\lfloor (\pi-\lfloor\pi\rfloor) * 10^{35} \rfloor$ be the same?

    – AKroell Aug 13 '15 at 11:48
  • @awk It would be close, but it would have a bunch of trailing zeros. So divide by $10^{35}$ – Gregory Grant Aug 13 '15 at 12:40
  • Wouldn't the zeroes be at the front like 00000123? – AKroell Aug 13 '15 at 12:43
  • @awk Actually we're both wrong, you would have to multiply the second term by $10^{16}$ before subtracting, then you would still have the trailing zeros so divide the whole thing by $10^{16}$ again. – Gregory Grant Aug 13 '15 at 12:45
  • @awk I had some missing parentheses as I originally stated it, but I think it's right now. – Gregory Grant Aug 13 '15 at 22:17
1

In theoretical computer science, the notation $u[i,j]$ is frequently used to denote the factor $a_ia_{i+1} \dots a_j$ of an infinite word $u = a_0a_1 \dotsm$. Considering a number as an infinite word on the alphabet $\{0, \dotsm, 9\}$, you could adapt this notation and write something like $\pi[35,46]$. The obvious problem is the radix point, but you could work on the alphabet $\{0, \dotsm, 9, .\}$ instead and define the position of the radix point as $0$. With these conventions, for the real number $r = \sqrt{54321} = 233.068659412 \dotsm$, you could write $r[-2,6]= 33.068659$.

J.-E. Pin
  • 40,163
1

This might be best approached by carefully doing a small example. Suppose we'd like to capture the $926$ in $\pi=3.1415{\color\red{926}}5\ldots$. Note that $10^4\pi=31415.9265\ldots$, hence

$$10^4\pi-\lfloor10^4\pi\rfloor=0.9265\ldots$$

and thus

$$926=\lfloor10^3\cdot0.9265\ldots\rfloor=\lfloor10^7\pi-10^3\lfloor10^4\pi\rfloor\rfloor$$

For the specific example the OP mentioned, i.e. decimal positions 35-46, it should be clear the answer has the form

$$\lfloor10^n\pi-10^{12}\lfloor10^{n-12}\pi\rfloor\rfloor$$

where $n$ is either $45$ or $46$, depending on whether you count decimal positions starting at the $3$ or not. (I.e., does $926$ correspond to decimal positions 6-8 or 5-7?)

Barry Cipra
  • 79,832