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.

This page as a plain text file.
%I A385827 #20 Jul 27 2025 00:21:11
%S A385827 0,2,5,7,9,12,14,16,18,21,23,25,28,30,32,35,37,39,42,44,46,49,51,53,
%T A385827 56,58,60,63,65,67,70,72,74,77,79,81,84,86,88,90,93,95,97,100,102,104,
%U A385827 107,109,111,114,116,118,121,123,125,128,130,132,135,137,139,142,144,146,149
%N A385827 a(n) is the unique k such that 2^k is closest to 5^n.
%C A385827 a(n) is the unique k such that 2^k/5^n is closest to 1.
%C A385827 For all n, 2/3 < 2^a(n)/5^n < 4/3.
%C A385827 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.
%H A385827 A. Gorman-Huang and E. Marks, <a href="http://girlsangle.org/page/bulletin-archive/GABv18n05E.pdf">Approximating Powers of 2 Using Powers of 3 and Break Point Rounding</a>, Girls' Angle Bulletin, Vol. 18, No. 5 (2025), 8-10.
%F A385827 a(n) = -floor(-n*log_2(5) + log_2(3/2)).
%e A385827 a(3) = 7 because 2^7 = 128 is the closest power of 2 to 5^3 = 125.
%t A385827 a[n_]:=-Floor[-n*Log2[5] + Log2[3/2]]; Array[a,65,0] (* _Stefano Spezia_, Jul 17 2025 *)
%o A385827 (Python)
%o A385827 def A385827(n):
%o A385827     if n == 0: return 0
%o A385827     k = 5**n
%o A385827     m = k.bit_length()-2
%o A385827     return m+1+(k>3<<m) # _Chai Wah Wu_, Jul 22 2025
%Y A385827 Cf. A020857, A061785.
%K A385827 easy,nonn
%O A385827 0,2
%A A385827 _Richard S. Chang_, Jul 09 2025