login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A286574 Sum of the binary weights of the lengths of 1-runs in base-2 representation of n: a(n) = A000523(A286575(n)). 4
0, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, 2, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 2, 2, 3, 3, 3, 3, 4, 3, 4, 2, 3, 3, 3, 3, 4, 2, 3, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 2, 2, 3, 3, 3, 3, 4, 3, 4, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
COMMENTS
a(0) = 0 (an empty sum).
LINKS
FORMULA
a(n) = A000523(A286575(n)). [Log_2 of run-length transform of A001316.]
a(n) = A064547(A005940(1+n)).
EXAMPLE
For n = 27, "11011" in binary, there are two 1-runs, both of length 2, thus a(27) = A000120(2) + A000120(2) = 1 + 1 = 2.
For n = 29, "11101" in binary, there are two 1-runs, of lengths 1 and 3, thus a(29) = A000120(1) + A000120(3) = 1 + 2 = 3.
For n = 61, "111101" in binary, there are two 1-runs, of lengths 1 and 4, thus a(61) = A000120(1) + A000120(4) = 1 + 1 = 2.
PROG
(Scheme) (define (A286574 n) (A000523 (A286575 n)))
(Python)
from sympy import factorint, prime, log
import math
def wt(n): return bin(n).count("1")
def a037445(n):
f=factorint(n)
return 2**sum([wt(f[i]) for i in f])
def A(n): return n - 2**int(math.floor(log(n, 2)))
def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
def a286575(n): return a037445(b(n))
def a(n): return int(math.floor(log(a286575(n), 2))) # Indranil Ghosh, May 30 2017
(Python)
# uses RLT function from A278159
def A286574(n): return len(bin(RLT(n, lambda m: 2**(bin(m).count('1')))))-3 # Chai Wah Wu, Feb 04 2022
CROSSREFS
Sequence in context: A322867 A163109 A359289 * A329320 A316112 A317994
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, May 28 2017
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 20:13 EDT 2024. Contains 372317 sequences. (Running on oeis4.)