%I #35 Sep 16 2024 12:48:25
%S 1,1,2,1,2,1,3,2,1,3,2,4,1,3,2,4,1,3,5,2,4,1,3,5,2,4,6,1,3,5,2,4,6,1,
%T 3,5,7,2,4,6,1,3,5,7,2,4,6,1,8,3,5,7,2,4,6,1,8,3,5,7,2,9,4,6,1,8,3,5,
%U 7,2,9,4,6,1,8,3,10,5,7,2,9,4,6,1,8,3
%N Values of j in the numbers 2^i*3^j, i >= 1, j >= 1, arranged in increasing order (A033845).
%C This is the signature sequence of log(2)/log(3) (compare A022328). - _N. J. A. Sloane_, May 26 2024
%H Zak Seidov, <a href="/A191476/b191476.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Si#signature_sequences">Index entries for sequences related to signature sequences</a>
%e a(10) = 3 because A033845(10) = 108 = 2^2*3^3.
%e a(100) = 7 because A033845(100) = 59872 = 2^8*3^7.
%e a(1000) = 1 because A033845(1000) = 216172782113783808 = 2^56*3^1.
%t mx = 1000000; t = Select[Sort[Flatten[Table[2^i 3^j, {i, Log[2, mx]}, {j, Log[3, mx]}]]], # <= mx &]; Table[FactorInteger[i][[2, 2]], {i, t}] (* _T. D. Noe_, Aug 31 2012 *)
%o (Python)
%o from sympy import integer_log
%o def A191476(n):
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x,3)[0]+1))
%o return 1+integer_log((m:=bisection(f,n,n))>>(~m&m-1).bit_length(),3)[0] # _Chai Wah Wu_, Sep 15 2024
%Y Cf. A033845 (numbers 2^i*3^j), A191475 (values of i).
%Y A022329 (= a(n)-1) is an essentially identical sequence.
%Y See also A022328.
%K nonn
%O 1,3
%A _Zak Seidov_, Aug 30 2012
%E Edited by _N. J. A. Sloane_, May 26 2024