OFFSET
1,6
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = floor((log_2(n) - floor(log_2(n)))*n).
From Alois P. Heinz, Jan 04 2021: (Start)
a(n) = 0 <=> n in { A000079 }. (End)
MAPLE
a:= n-> floor(n*log[2](n))-n*ilog2(n):
seq(a(n), n=1..80); # Alois P. Heinz, Jan 04 2021
MATHEMATICA
a[n_]:=Floor[FractionalPart[Log[2, n]]*n];
Table[a[n], {n, 1, 100}]
PROG
(PARI) a(n) = floor(n*frac(log(n)/log(2))); \\ Michel Marcus, Jul 07 2020
(Python)
def A336018(n):
return len(bin(n**n//(2**((len(bin(n))-3)*n))))-3 # Chai Wah Wu, Jul 09 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Andres Cicuttin, Jul 04 2020
STATUS
approved