Pre-requisite Definition
For any integer $n\geq 0$ and base $b \geq 2$ as follows, we define the following function, known as the radical-inverse function, \begin{align} \phi_b(n)=\sum_{j=1}^m a_j b^{-j}=\frac{a_1}{b}+\frac{a_2}{b^2}\cdots \end{align} for $a_j$ ranging 0 to $b-1$, $m, b\in \mathbb{Z}$.For dimension $s$, the Halton sequence is defined as, \begin{align} x_n^s=(\phi_{p_1}(n), \phi_{p_2} (n), \cdots,\phi_{p_s}(n)) \end{align}
Where, $p_1, p_2 \cdots p_s$ must are co-prime integers. It is common to simply use the $n^{th}$ prime number at each stage.
Example
$x_n=\phi_2(n)$ gives us a special case of the Halton sequence called the van der Corput sequence. Below I have enumerated the first 5 values of the van der Corput sequence as an example.Question
How do I generate a set of $n$ Halton numbers in dimension $s$? And plot a ListPlot of it?Attempt
I tried to simply generate $\phi_2$ as follows, but it doesn't work.radinv[x_, b_] := InverseFunction[BaseForm[x, b]]
h2 = Table[radinv[x, 2], {x, 0, 10}]
The reason I wanted to do this is to see the artifacts (stripes of numbers instead of uniformly spread out) that occur for higher dimensions.
Thanks for any and all help!
halton[base_,len_]:=Table[With[{digits=Reverse@IntegerDigits[n,base]},Sum[base^(-ii)*digits[[ii]],{ii,Length[digits]}]],{n,len}]
will do what you're after, adapter from the example in Mathematica docs... $\endgroup$ResourceFunction["RadicalInverse"]
. There's a 2D sequence example in the Applications section on that page. $\endgroup$