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!)
A361477 a(n) is the number of integers whose binary expansions have the same multiset of run-lengths as that of n. 2
1, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 3, 1, 3, 2, 1, 2, 3, 4, 3, 4, 1, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 6, 6, 5, 6, 6, 4, 5, 1, 5, 6, 5, 4, 3, 2, 6, 6, 1, 6, 5, 6, 6, 1, 6, 4, 6, 2, 3, 2, 1, 2, 3, 4, 6, 12, 5, 12, 3, 12, 10, 6, 10, 4, 10, 12, 6, 4, 5, 6, 10 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
This sequence has similarities with A090706; here we consider multisets of run-lengths, there multisets of digits in binary expansions.
LINKS
FORMULA
a(n) = 1 iff n = 0 or n belongs to A140690.
EXAMPLE
For n = 18:
- the binary expansion of 18 is "10010",
- the corresponding multiset of run-lengths is m = (1, 2, 1, 1),
- m has 4 terms: 3 times "1" and once "2",
- so a(18) = 4! / (3! * 1!) = 4.
PROG
(PARI) a(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); my (s=Set(r), f=vector(#s)); for (k=1, #r, f[setsearch(s, r[k])]++); (#r)! / prod(k=1, #f, f[k]!) }
(Python)
from math import factorial, prod
from itertools import groupby
from collections import Counter
def A361477(n): return factorial(len(c:=[len(list(g)) for k, g in groupby(bin(n)[2:])]))//prod(map(factorial, Counter(c).values())) # Chai Wah Wu, Mar 16 2023
CROSSREFS
Sequence in context: A308916 A353171 A182628 * A331366 A274225 A028334
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 13 2023
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 April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)