login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A336018 a(n) = floor(frac(log_2(n))*n), where frac denotes the fractional part. 3
0, 0, 1, 0, 1, 3, 5, 0, 1, 3, 5, 7, 9, 11, 13, 0, 1, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 27, 29, 0, 1, 2, 4, 6, 7, 9, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 45, 47, 49, 52, 54, 56, 59, 61, 0, 1, 2, 4, 5, 7, 9, 10, 12, 13 (list; graph; refs; listen; history; text; internal format)
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) = A326299(n) - A340301(n).

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

Cf. A000079, A000523, A000195, A336017, A326299, A340301.

Sequence in context: A087676 A291207 A058813 * A132701 A215016 A212394

Adjacent sequences:  A336015 A336016 A336017 * A336019 A336020 A336021

KEYWORD

nonn

AUTHOR

Andres Cicuttin, Jul 04 2020

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 11 22:16 EDT 2021. Contains 342892 sequences. (Running on oeis4.)