[go: up one dir, main page]

login
A191475
Values of i in the numbers 2^i*3^j, i >= 1, j >= 1 (A033845).
8
1, 2, 1, 3, 2, 4, 1, 3, 5, 2, 4, 1, 6, 3, 5, 2, 7, 4, 1, 6, 3, 8, 5, 2, 7, 4, 1, 9, 6, 3, 8, 5, 2, 10, 7, 4, 1, 9, 6, 3, 11, 8, 5, 2, 10, 7, 4, 12, 1, 9, 6, 3, 11, 8, 5, 13, 2, 10, 7, 4, 12, 1, 9, 6, 14, 3, 11, 8, 5, 13, 2, 10, 7, 15, 4, 12, 1, 9, 6, 14, 3, 11
OFFSET
1,2
COMMENTS
Signature sequence of log_2(3) (A020857). - R. J. Mathar, May 27 2024
EXAMPLE
a(10) = 2 because A033845(10) = 108 = 2^2*3^3.
a(100) = 2 because A033845(100) = 59872 = 2^8*3^7.
a(1000) = 56 because A033845(1000) = 216172782113783808 = 2^56*3^1.
MATHEMATICA
mx = 1000000; t = Select[Sort[Flatten[Table[2^i 3^j, {i, Log[2, mx]}, {j, Log[3, mx]}]]], # <= mx &]; Table[FactorInteger[i][[1, 2]], {i, t}] (* T. D. Noe, Aug 31 2012 *)
PROG
(Python)
from sympy import integer_log
def A191475(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x): return n+x-sum((x//3**i).bit_length() for i in range(integer_log(x, 3)[0]+1))
return 1+(~(m:=bisection(f, n, n))&m-1).bit_length() # Chai Wah Wu, Sep 15 2024
CROSSREFS
Cf. A003586 (numbers 2^i*3^j, i >= 0, j >= 0), A033845 (numbers 2^i*3^j, i >= 1, j >= 1), A191476 (values of j), A020857.
Sequence in context: A058933 A087470 A373215 * A158456 A084531 A023129
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 30 2012
EXTENSIONS
Edited by N. J. A. Sloane, May 26 2024
STATUS
approved