totalsiffror
Totalsiffror is a term used in Swedish mathematics and computer science that can refer to two related notions involving digit counts. In one sense, totalsiffror denotes the number of digits in a single positive integer. In another sense, it denotes the total number of digits required to write all integers in a given range, typically from 1 up to some n.
For a positive integer n, the number of digits in its decimal representation is digits(n) = floor(log10(n))
The range interpretation, often called the total number of digits from 1 to n, is denoted D(n)
Examples help illustrate: D(13) = 13 (1–9 contribute 9 digits, 10–13 contribute 4 digits). D(99) = 189. D(999)
Totalsiffror appears in problems about counting digits, numeral systems, and algorithm analysis where the cost is