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.
%I A064514 #17 Apr 22 2025 02:16:32 %S A064514 0,1,2,2,3,4,3,4,5,4,6,5,6,5,7,6,8,7,6,8,7,9,8,10,7,9,8,10,9,11,8,10, %T A064514 12,9,11,10,12,9,11,13,10,12,14,11,13,10,12,14,11,13,15,12,14,11,16, %U A064514 13,15,12,14,16,13,15,12,17,14,16,13,18,15,17,14,16,13,18,15,17,14,19,16 %N A064514 Write A064476(n) = 2^i(n)*3^j(n); sequence gives values of i(n). %o A064514 (ARIBAS) function a064514(maxarg: integer); var j: integer; ar: array; begin ar := p2p3(maxarg); for j := 0 to maxarg - 1 do write(ar[j][1]," "); end; end; a064514(85); (* For definition of function p2p3 see A064476. *) %o A064514 (Python) %o A064514 from sympy import integer_log %o A064514 def A064514(n): %o A064514 def bisection(f,kmin=0,kmax=1): %o A064514 while f(kmax) > kmax: kmax <<= 1 %o A064514 kmin = kmax >> 1 %o A064514 while kmax-kmin > 1: %o A064514 kmid = kmax+kmin>>1 %o A064514 if f(kmid) <= kmid: %o A064514 kmax = kmid %o A064514 else: %o A064514 kmin = kmid %o A064514 return kmax %o A064514 def f(x): return n+x-sum(max(0,min((i<<1)+1,(x//3**i).bit_length())-i) for i in range(integer_log(x,3)[0]+1)) %o A064514 return ((m:=bisection(f,n,n))-1&~m).bit_length() # _Chai Wah Wu_, Mar 26 2025 %Y A064514 Cf. A064476, A064515. %K A064514 nonn,easy %O A064514 1,3 %A A064514 _Vladeta Jovovic_, Oct 07 2001 %E A064514 More terms from _Klaus Brockhaus_, Oct 12 2001