login
A099396
a(n) = floor(log_2((2/3)*n)) for n >= 2, a(1) = 0.
3
0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6
OFFSET
1,6
FORMULA
G.f.: (1/(1-x)) * Sum_{k>=0} x^(3*2^k).
MAPLE
0, seq(ilog2(2/3*n), n=2..110); # Georg Fischer, Aug 31 2021
MATHEMATICA
Join[{0}, Floor[Log[2, 2/3 Range[2, 110]]]] (* Harvey P. Dale, Mar 01 2012 *)
PROG
(PARI) a(n) = if(n == 1, 0, my(L = logint(n, 2)); L + bittest(n, L-1) - 1) \\ Mikhail Kurkov, Mar 13 2024
CROSSREFS
First differences are in A099395. Cf. A004762, A007283.
Sequence in context: A080342 A081604 A123119 * A126235 A220104 A191228
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Oct 21 2004
EXTENSIONS
Definition corrected by Georg Fischer, Aug 31 2021
STATUS
approved