login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A334588 Distance of closest integer power of 10 to the n-th power of 2. 1
0, 1, 3, 2, 6, 22, 36, 28, 156, 412, 24, 1048, 3096, 1808, 6384, 22768, 34464, 31072, 162144, 424288, 48576, 1097152, 3194304, 1611392, 6777216, 23554432, 32891136, 34217728, 168435456, 436870912, 73741824, 1147483648, 3294967296, 1410065408, 7179869184, 24359738368 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(n) is a measure for how well powers of 2 may be approximated by powers of 10. It is e.g. relevant to unit conventions for the magnitude of data (e.g. 1 megabyte is approximately 1 mebibyte). The closely related sequence of distances of the closest integer power of 2 to the n-th power of 10 gives a measure for the precision of floating point expressions in computing applications.
LINKS
Wikipedia, Mebibyte
EXAMPLE
For n=2, a(2) = |4-1| = 3.
For n=10, a(10) = min(|2^10-10^3|,|2^10-10^4|) = |1024-1000| = 24.
MAPLE
a:= n-> (m-> (p-> min(m-10^p, 10^(p+1)-m))(ilog10(m)))(2^n):
seq(a(n), n=0..37); # Alois P. Heinz, May 07 2020
MATHEMATICA
A[n_] := Min[Abs[(2^n) - 10^Length[IntegerDigits[2^n]]],
Abs[(2^n) - 10^(Length[IntegerDigits[2^n]] - 1)]]
PROG
(PARI) a(n) = my(i=logint(2^n, 10)); min(abs(10^i-2^n), abs(10*10^i-2^n)); \\ Jinyuan Wang, May 06 2020
CROSSREFS
Cf. A000079 (2^n), A011557 (10^n).
Sequence in context: A110768 A140230 A356563 * A025240 A137602 A086550
KEYWORD
nonn
AUTHOR
Timon S. Gutleb, May 06 2020
EXTENSIONS
More terms from Jinyuan Wang, May 06 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)