Creating a grid of coloured points

49 Views Asked by At

I wish to create a grid of $31\times31$ points with coordinates of the form $(\frac k{30};\frac n{30})$ within the unit square, and give each point a colour based on the 2-adic value of both its coordinates.

I plan to use Wolfram Mathematica, as this program has a simple function to calculate the 2-adic value, but I do not know how to generate a grid in which I can assign colours to the points. If we write $v(x)$ as the 2-adic value of $x$, the colouring should be as follows:

$(x,y)$ is coloured:

  • Blue if $v(x) \geq v(y)$ and $v(x) \geq v(1)=1$
  • Green if $v(x) < v(y)$ and $v(y) \geq v(1)=1$
  • Red if $v(x) < v(1)=1 $ and $ v(y) < v(1)=1$

Can someone help me?