Suppose I have a base two number that repeats itself every five places (a number $x$ such that $0\le x<1$. For example:
$$x=0.101011010110101101011010110101101011010110101...$$
What would be a cool way to start with:
x={1,0,1,0,1}
Then, thinking of this five number list as repeating itself forever, use Mathematica to change it to a base 10 number.
Update: My question came as a result of @Kagaratsch's answer at Using a piecewise defined sequence, find all $x_0$. Thanks to @Xavier's answer, now I can do this:
mytup = Tuples[{0, 1}, 5]
FromDigits[{{#}, 0}, 2] & /@ Most[mytup]
{1, 0, 1, 0, 1}. (2)^Range[0, 4]/(2^5 - 1) //N– Michael E2 Dec 07 '15 at 03:22NSum[{1, 0, 1, 0, 1}. (2)^-Range[n + 1, n + 5], {n, 0, Infinity, 5}]– Michael E2 Dec 07 '15 at 03:24Sumproduces the exact21/31result. – george2079 Dec 07 '15 at 18:07RealDigits@Sum[{1, 0, 1, 0, 1}. (2)^-Range[n + 1, n + 5], {n, 0, Infinity, 5}]or{1, 0, 1, 0, 1}. (2)^Range[0, 4]/(2^5 - 1) // RealDigitsmight be more in line with @David's question. – Michael E2 Dec 07 '15 at 21:54