cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385827 a(n) is the unique k such that 2^k is closest to 5^n.

Original entry on oeis.org

0, 2, 5, 7, 9, 12, 14, 16, 18, 21, 23, 25, 28, 30, 32, 35, 37, 39, 42, 44, 46, 49, 51, 53, 56, 58, 60, 63, 65, 67, 70, 72, 74, 77, 79, 81, 84, 86, 88, 90, 93, 95, 97, 100, 102, 104, 107, 109, 111, 114, 116, 118, 121, 123, 125, 128, 130, 132, 135, 137, 139, 142, 144, 146, 149
Offset: 0

Views

Author

Richard S. Chang, Jul 09 2025

Keywords

Comments

a(n) is the unique k such that 2^k/5^n is closest to 1.
For all n, 2/3 < 2^a(n)/5^n < 4/3.
For n > 0, a(n) = A061785(n) if log_2(2*5^n/3) < floor(n*log_2(5)), otherwise a(n) = A061785(n) + 1.

Examples

			a(3) = 7 because 2^7 = 128 is the closest power of 2 to 5^3 = 125.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=-Floor[-n*Log2[5] + Log2[3/2]]; Array[a,65,0] (* Stefano Spezia, Jul 17 2025 *)
  • Python
    def A385827(n):
        if n == 0: return 0
        k = 5**n
        m = k.bit_length()-2
        return m+1+(k>3<Chai Wah Wu, Jul 22 2025

Formula

a(n) = -floor(-n*log_2(5) + log_2(3/2)).