Search code examples
wolfram-mathematicaloggingmathematica-8

Logarithmically spacing number


I would like to test several values of intensity.

I need them to be spaced logarithmically from 1 to 1000. Yet I just use 1, 10, 100, 1000, but I would like to have more data point, let`s say 10.

How could I find 10 logarithmically spaced number between 1 and 1000 in Mathematica ?


Solution

  • If a is start, c is end and b is number of intervals:

    {a, b, c} = {1, 10, 1000};
    t = (c/a)^(1/b) // N
    a*t^Range[b]
    
    1.99526
    {1.99526, 3.98107, 7.94328, 15.8489, 31.6228, 63.0957, 125.893, 251.189, 501.187, 1000.}
    

    I used N just to see better, what do we have.