PowerRange[b]
generates the list {1,10,100,…,max}, where max is the largest power of 10 that does not exceed b.
PowerRange[a,b]
generates the list {a,10a,100a,…,max}, with successive elements increasing by factors of 10.
PowerRange[a,b,r]
uses factors of r instead of 10.
PowerRange
PowerRange[b]
generates the list {1,10,100,…,max}, where max is the largest power of 10 that does not exceed b.
PowerRange[a,b]
generates the list {a,10a,100a,…,max}, with successive elements increasing by factors of 10.
PowerRange[a,b,r]
uses factors of r instead of 10.
Details
- PowerRange effectively behaves like Range, but in "log-space".
- The arguments a and b to PowerRange need not be integers or powers of r, but must be either both positive or both negative.
- PowerRange starts from a and successively multiplies by r until the result is larger than b.
- If b/a is not a power of r, the endpoint b will not be included in the list generated by PowerRange. »
Examples
open all close allBasic Examples (2)
Scope (5)
Specify a power other than 10:
PowerRange[10, 5000, 5]The endpoint 5000 is not included since the ratio of endpoints is not an integer power of 5:
Log[5, (5000/50)]//NUse a ratio whose magnitude is less than 1:
PowerRange[2, 1 / 8, 1 / 2]Use a negative ratio; the cutoff is determined by magnitude only:
PowerRange[10, 10000, -5]A range with negative numbers:
PowerRange[-1, -5000]Parameters need not be numeric:
PowerRange[a, a ^ 10, a]PowerRange[y / x ^ 2, y * x ^ 2, x]PowerRange[1, x^10, Sqrt[x]]Properties & Relations (4)
PowerRange produces lists whose elements have a constant ratio:
PowerRange[1, 125, 5]Ratios[%]Range produces lists whose elements have a constant difference:
Range[0, 25, 5]Differences[%]For positive a and b, PowerRange[a,b] equals 10^Range[Log10[a],Log10[b]]:
PowerRange[5, 5000] == 10 ^ Range[Log10[5], Log10[5000]]//QuietIf moreover r>1, PowerRange[a,b,r] equals r^Range[Log[r,a],Log[r,b]]:
PowerRange[1, 1000, 2] == 2 ^ Range[Log[2, 1], Log[2, 1000]]//QuietPowerRange can be implemented with NestWhileList:
PowerRange[1, 1000000]NestWhileList[10#&, 1, # < 1000000&]PowerRange produces an explicit list of values with a constant ratio:
PowerRange[5, 10000, 7]RSolveValue generates a formula for generating such a list:
RSolveValue[{a[n + 1] == 7a[n], a[1] == 5}, a[n], n]Table[%, {n, 4}]See Also
Range Ratios FindDivisions Power Exp RSolveValue NestWhileList FromDigits
Function Repository: PowerSubdivide
Related Guides
History
Text
Wolfram Research (2014), PowerRange, Wolfram Language function, https://reference.wolfram.com/language/ref/PowerRange.html.
CMS
Wolfram Language. 2014. "PowerRange." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PowerRange.html.
APA
Wolfram Language. (2014). PowerRange. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PowerRange.html
BibTeX
@misc{reference.wolfram_2026_powerrange, author="Wolfram Research", title="{PowerRange}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/PowerRange.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_powerrange, organization={Wolfram Research}, title={PowerRange}, year={2014}, url={https://reference.wolfram.com/language/ref/PowerRange.html}, note=[Accessed: 13-June-2026]}