Convert a linear scale to a logarithmic scale

Solution 1:

let $f(n)$ be the log function of n.

So a general log function can be written as $f(n)=k\log n +c$

where $k$ and $c$ are constants

$\implies 255=k\log {10^6}+c$

and $0=k\log {1}+c$

here is to the base 10

so $c=0$ and $k=255/6$

or here you can use any base and different values of k

so that $f(n)=\frac {255 \log n}{6}$ if the base is 10.